[Lldb-commits] [lldb] r280751 - *** This commit represents a complete reformatting of the LLDB source code

Kate Stone via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 6 13:58:36 PDT 2016


Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py Tue Sep  6 15:57:50 2016
@@ -13,7 +13,6 @@ the initial set of tests implemented.
 from __future__ import print_function
 
 
-
 import unittest2
 import gdbremote_testcase
 import lldbgdbserverutils
@@ -23,6 +22,7 @@ from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
+
 class LldbGdbServerTestCase(gdbremote_testcase.GdbRemoteTestCaseBase):
 
     mydir = TestBase.compute_mydir(__file__)
@@ -137,7 +137,7 @@ class LldbGdbServerTestCase(gdbremote_te
         self.add_verified_launch_packets(launch_args)
         self.test_sequence.add_log_lines(
             ["read packet: $vCont;c#a8",
-             {"type":"output_match", "regex": self.maybe_strict_output_regex(r"hello, world\r\n")},
+             {"type": "output_match", "regex": self.maybe_strict_output_regex(r"hello, world\r\n")},
              "send packet: $W00#00"],
             True)
 
@@ -168,12 +168,15 @@ class LldbGdbServerTestCase(gdbremote_te
 
         self.add_no_ack_remote_stream()
         self.add_verified_launch_packets(launch_args)
-        self.test_sequence.add_log_lines(
-            ["read packet: $qC#00",
-             { "direction":"send", "regex":r"^\$QC([0-9a-fA-F]+)#", "capture":{1:"thread_id"} },
-             "read packet: $?#00",
-             { "direction":"send", "regex":r"^\$T[0-9a-fA-F]{2}thread:([0-9a-fA-F]+)", "expect_captures":{1:"thread_id"} }],
-            True)
+        self.test_sequence.add_log_lines(["read packet: $qC#00",
+                                          {"direction": "send",
+                                           "regex": r"^\$QC([0-9a-fA-F]+)#",
+                                           "capture": {1: "thread_id"}},
+                                          "read packet: $?#00",
+                                          {"direction": "send",
+                                              "regex": r"^\$T[0-9a-fA-F]{2}thread:([0-9a-fA-F]+)",
+                                              "expect_captures": {1: "thread_id"}}],
+                                         True)
         self.expect_gdbremote_sequence()
 
     @debugserver_test
@@ -196,7 +199,8 @@ class LldbGdbServerTestCase(gdbremote_te
             True)
         self.expect_gdbremote_sequence()
 
-        # Wait a moment for completed and now-detached inferior process to clear.
+        # Wait a moment for completed and now-detached inferior process to
+        # clear.
         time.sleep(1)
 
         if not lldb.remote_platform:
@@ -204,8 +208,11 @@ class LldbGdbServerTestCase(gdbremote_te
             poll_result = procs["inferior"].poll()
             self.assertIsNotNone(poll_result)
 
-        # Where possible, verify at the system level that the process is not running.
-        self.assertFalse(lldbgdbserverutils.process_is_running(procs["inferior"].pid, False))
+        # Where possible, verify at the system level that the process is not
+        # running.
+        self.assertFalse(
+            lldbgdbserverutils.process_is_running(
+                procs["inferior"].pid, False))
 
     @debugserver_test
     def test_attach_commandline_continue_app_exits_debugserver(self):
@@ -232,7 +239,7 @@ class LldbGdbServerTestCase(gdbremote_te
         self.add_verified_launch_packets(launch_args)
         self.test_sequence.add_log_lines(
             ["read packet: $qRegisterInfo0#00",
-             { "direction":"send", "regex":r"^\$(.+);#[0-9A-Fa-f]{2}", "capture":{1:"reginfo_0"} }],
+             {"direction": "send", "regex": r"^\$(.+);#[0-9A-Fa-f]{2}", "capture": {1: "reginfo_0"}}],
             True)
 
         # Run the stream
@@ -241,7 +248,8 @@ class LldbGdbServerTestCase(gdbremote_te
 
         reg_info_packet = context.get("reginfo_0")
         self.assertIsNotNone(reg_info_packet)
-        self.assert_valid_reg_info(lldbgdbserverutils.parse_reg_info_response(reg_info_packet))
+        self.assert_valid_reg_info(
+            lldbgdbserverutils.parse_reg_info_response(reg_info_packet))
 
     @debugserver_test
     @expectedFailureDarwin("llvm.org/pr25486")
@@ -307,7 +315,8 @@ class LldbGdbServerTestCase(gdbremote_te
         reg_infos = self.parse_register_info_packets(context)
 
         # Collect all generic registers found.
-        generic_regs = { reg_info['generic']:1 for reg_info in reg_infos if 'generic' in reg_info }
+        generic_regs = {
+            reg_info['generic']: 1 for reg_info in reg_infos if 'generic' in reg_info}
 
         # Ensure we have a program counter register.
         self.assertTrue('pc' in generic_regs)
@@ -352,11 +361,13 @@ class LldbGdbServerTestCase(gdbremote_te
         reg_infos = self.parse_register_info_packets(context)
 
         # Collect all register sets found.
-        register_sets = { reg_info['set']:1 for reg_info in reg_infos if 'set' in reg_info }
+        register_sets = {
+            reg_info['set']: 1 for reg_info in reg_infos if 'set' in reg_info}
         self.assertTrue(len(register_sets) >= 1)
 
     @debugserver_test
-    def test_qRegisterInfo_contains_at_least_one_register_set_debugserver(self):
+    def test_qRegisterInfo_contains_at_least_one_register_set_debugserver(
+            self):
         self.init_debugserver_test()
         self.build()
         self.qRegisterInfo_contains_at_least_one_register_set()
@@ -406,8 +417,11 @@ class LldbGdbServerTestCase(gdbremote_te
         reg_infos = self.parse_register_info_packets(context)
 
         # Collect all generics found.
-        register_sets = { reg_info['set']:1 for reg_info in reg_infos if 'set' in reg_info }
-        self.assertEqual(self.targetHasAVX(), "Advanced Vector Extensions" in register_sets)
+        register_sets = {
+            reg_info['set']: 1 for reg_info in reg_infos if 'set' in reg_info}
+        self.assertEqual(
+            self.targetHasAVX(),
+            "Advanced Vector Extensions" in register_sets)
 
     @llgs_test
     def test_qRegisterInfo_contains_avx_registers_llgs(self):
@@ -464,7 +478,7 @@ class LldbGdbServerTestCase(gdbremote_te
         self.add_threadinfo_collection_packets()
         self.test_sequence.add_log_lines(
             ["read packet: $qC#00",
-             { "direction":"send", "regex":r"^\$QC([0-9a-fA-F]+)#", "capture":{1:"thread_id"} }
+             {"direction": "send", "regex": r"^\$QC([0-9a-fA-F]+)#", "capture": {1: "thread_id"}}
              ], True)
 
         # Run the packet stream.
@@ -532,7 +546,8 @@ class LldbGdbServerTestCase(gdbremote_te
         for reg_info in reg_infos:
             # Skip registers that don't have a register set.  For x86, these are
             # the DRx registers, which have no LLDB-kind register number and thus
-            # cannot be read via normal NativeRegisterContext::ReadRegister(reg_info,...) calls.
+            # cannot be read via normal
+            # NativeRegisterContext::ReadRegister(reg_info,...) calls.
             if not "set" in reg_info:
                 continue
 
@@ -542,7 +557,7 @@ class LldbGdbServerTestCase(gdbremote_te
             # Run the register query
             self.test_sequence.add_log_lines(
                 ["read packet: $p{0:x}#00".format(reg_index),
-                 { "direction":"send", "regex":r"^\$([0-9a-fA-F]+)#", "capture":{1:"p_response"} }],
+                 {"direction": "send", "regex": r"^\$([0-9a-fA-F]+)#", "capture": {1: "p_response"}}],
                 True)
             context = self.expect_gdbremote_sequence()
             self.assertIsNotNone(context)
@@ -556,28 +571,32 @@ class LldbGdbServerTestCase(gdbremote_te
             reg_index += 1
 
     @debugserver_test
-    def test_p_returns_correct_data_size_for_each_qRegisterInfo_launch_debugserver(self):
+    def test_p_returns_correct_data_size_for_each_qRegisterInfo_launch_debugserver(
+            self):
         self.init_debugserver_test()
         self.build()
         self.set_inferior_startup_launch()
         self.p_returns_correct_data_size_for_each_qRegisterInfo()
 
     @llgs_test
-    def test_p_returns_correct_data_size_for_each_qRegisterInfo_launch_llgs(self):
+    def test_p_returns_correct_data_size_for_each_qRegisterInfo_launch_llgs(
+            self):
         self.init_llgs_test()
         self.build()
         self.set_inferior_startup_launch()
         self.p_returns_correct_data_size_for_each_qRegisterInfo()
 
     @debugserver_test
-    def test_p_returns_correct_data_size_for_each_qRegisterInfo_attach_debugserver(self):
+    def test_p_returns_correct_data_size_for_each_qRegisterInfo_attach_debugserver(
+            self):
         self.init_debugserver_test()
         self.build()
         self.set_inferior_startup_attach()
         self.p_returns_correct_data_size_for_each_qRegisterInfo()
 
     @llgs_test
-    def test_p_returns_correct_data_size_for_each_qRegisterInfo_attach_llgs(self):
+    def test_p_returns_correct_data_size_for_each_qRegisterInfo_attach_llgs(
+            self):
         self.init_llgs_test()
         self.build()
         self.set_inferior_startup_attach()
@@ -585,9 +604,12 @@ class LldbGdbServerTestCase(gdbremote_te
 
     def Hg_switches_to_3_threads(self):
         # Startup the inferior with three threads (main + 2 new ones).
-        procs = self.prep_debug_monitor_and_inferior(inferior_args=["thread:new", "thread:new"])
+        procs = self.prep_debug_monitor_and_inferior(
+            inferior_args=["thread:new", "thread:new"])
 
-        # Let the inferior process have a few moments to start up the thread when launched.  (The launch scenario has no time to run, so threads won't be there yet.)
+        # Let the inferior process have a few moments to start up the thread
+        # when launched.  (The launch scenario has no time to run, so threads
+        # won't be there yet.)
         self.run_process_then_stop(run_seconds=1)
 
         # Wait at most x seconds for 3 threads to be present.
@@ -602,7 +624,7 @@ class LldbGdbServerTestCase(gdbremote_te
                 ["read packet: $Hg{0:x}#00".format(thread),  # Set current thread.
                  "send packet: $OK#00",
                  "read packet: $qC#00",
-                 { "direction":"send", "regex":r"^\$QC([0-9a-fA-F]+)#", "capture":{1:"thread_id"} }],
+                 {"direction": "send", "regex": r"^\$QC([0-9a-fA-F]+)#", "capture": {1: "thread_id"}}],
                 True)
 
             context = self.expect_gdbremote_sequence()
@@ -648,7 +670,7 @@ class LldbGdbServerTestCase(gdbremote_te
 
         # Startup the inferior with three threads (main + NUM_THREADS-1 worker threads).
         # inferior_args=["thread:print-ids"]
-        inferior_args=["thread:segfault"]
+        inferior_args = ["thread:segfault"]
         for i in range(NUM_THREADS - 1):
             # if i > 0:
                 # Give time between thread creation/segfaulting for the handler to work.
@@ -656,8 +678,10 @@ class LldbGdbServerTestCase(gdbremote_te
             inferior_args.append("thread:new")
         inferior_args.append("sleep:10")
 
-        # Launch/attach.  (In our case, this should only ever be launched since we need inferior stdout/stderr).
-        procs = self.prep_debug_monitor_and_inferior(inferior_args=inferior_args)
+        # Launch/attach.  (In our case, this should only ever be launched since
+        # we need inferior stdout/stderr).
+        procs = self.prep_debug_monitor_and_inferior(
+            inferior_args=inferior_args)
         self.test_sequence.add_log_lines(["read packet: $c#63"], True)
         context = self.expect_gdbremote_sequence()
 
@@ -675,9 +699,11 @@ class LldbGdbServerTestCase(gdbremote_te
         for i in range(NUM_THREADS - 1):
             # Run until SIGSEGV comes in.
             self.reset_test_sequence()
-            self.test_sequence.add_log_lines(
-                [{"direction":"send", "regex":r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);", "capture":{1:"signo", 2:"thread_id"} }
-                 ], True)
+            self.test_sequence.add_log_lines([{"direction": "send",
+                                               "regex": r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);",
+                                               "capture": {1: "signo",
+                                                            2: "thread_id"}}],
+                                             True)
 
             context = self.expect_gdbremote_sequence(timeout_seconds=10)
             self.assertIsNotNone(context)
@@ -693,23 +719,24 @@ class LldbGdbServerTestCase(gdbremote_te
             self.reset_test_sequence()
             self.test_sequence.add_log_lines(
                 [
-                # Set the continue thread.
-                 "read packet: $Hc{0:x}#00".format(thread_id),  # Set current thread.
-                 "send packet: $OK#00",
-
-                 # Continue sending the signal number to the continue thread.
-                 # The commented out packet is a way to do this same operation without using
-                 # a $Hc (but this test is testing $Hc, so we'll stick with the former).
-                 "read packet: $C{0:x}#00".format(lldbutil.get_signal_number('SIGUSR1')),
-                 # "read packet: $vCont;C{0:x}:{1:x};c#00".format(lldbutil.get_signal_number('SIGUSR1'), thread_id),
-
-                 # FIXME: Linux does not report the thread stop on the delivered signal (SIGUSR1 here).  MacOSX debugserver does.
-                 # But MacOSX debugserver isn't guaranteeing the thread the signal handler runs on, so currently its an XFAIL.
-                 # Need to rectify behavior here.  The linux behavior is more intuitive to me since we're essentially swapping out
-                 # an about-to-be-delivered signal (for which we already sent a stop packet) to a different signal.
-                 # {"direction":"send", "regex":r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);", "capture":{1:"stop_signo", 2:"stop_thread_id"} },
-                 #  "read packet: $c#63",
-                 { "type":"output_match", "regex":r"^received SIGUSR1 on thread id: ([0-9a-fA-F]+)\r\nthread ([0-9a-fA-F]+): past SIGSEGV\r\n", "capture":{ 1:"print_thread_id", 2:"post_handle_thread_id" } },
+                    # Set the continue thread.
+                    # Set current thread.
+                    "read packet: $Hc{0:x}#00".format(thread_id),
+                    "send packet: $OK#00",
+
+                    # Continue sending the signal number to the continue thread.
+                    # The commented out packet is a way to do this same operation without using
+                    # a $Hc (but this test is testing $Hc, so we'll stick with the former).
+                    "read packet: $C{0:x}#00".format(lldbutil.get_signal_number('SIGUSR1')),
+                    # "read packet: $vCont;C{0:x}:{1:x};c#00".format(lldbutil.get_signal_number('SIGUSR1'), thread_id),
+
+                    # FIXME: Linux does not report the thread stop on the delivered signal (SIGUSR1 here).  MacOSX debugserver does.
+                    # But MacOSX debugserver isn't guaranteeing the thread the signal handler runs on, so currently its an XFAIL.
+                    # Need to rectify behavior here.  The linux behavior is more intuitive to me since we're essentially swapping out
+                    # an about-to-be-delivered signal (for which we already sent a stop packet) to a different signal.
+                    # {"direction":"send", "regex":r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);", "capture":{1:"stop_signo", 2:"stop_thread_id"} },
+                    #  "read packet: $c#63",
+                    {"type": "output_match", "regex": r"^received SIGUSR1 on thread id: ([0-9a-fA-F]+)\r\nthread ([0-9a-fA-F]+): past SIGSEGV\r\n", "capture": {1: "print_thread_id", 2: "post_handle_thread_id"}},
                 ],
                 True)
 
@@ -727,16 +754,20 @@ class LldbGdbServerTestCase(gdbremote_te
             # self.assertIsNotNone(stop_thread_id)
             # self.assertEquals(int(stop_thread_id,16), thread_id)
 
-            # Ensure we haven't seen this thread id yet.  The inferior's self-obtained thread ids are not guaranteed to match the stub tids (at least on MacOSX).
+            # Ensure we haven't seen this thread id yet.  The inferior's
+            # self-obtained thread ids are not guaranteed to match the stub
+            # tids (at least on MacOSX).
             print_thread_id = context.get("print_thread_id")
             self.assertIsNotNone(print_thread_id)
             print_thread_id = int(print_thread_id, 16)
             self.assertFalse(print_thread_id in print_thread_ids)
-            
-            # Now remember this print (i.e. inferior-reflected) thread id and ensure we don't hit it again.
+
+            # Now remember this print (i.e. inferior-reflected) thread id and
+            # ensure we don't hit it again.
             print_thread_ids[print_thread_id] = 1
 
-            # Ensure post signal-handle thread id matches the thread that initially raised the SIGSEGV.
+            # Ensure post signal-handle thread id matches the thread that
+            # initially raised the SIGSEGV.
             post_handle_thread_id = context.get("post_handle_thread_id")
             self.assertIsNotNone(post_handle_thread_id)
             post_handle_thread_id = int(post_handle_thread_id, 16)
@@ -748,7 +779,8 @@ class LldbGdbServerTestCase(gdbremote_te
         self.init_debugserver_test()
         self.build()
         self.set_inferior_startup_launch()
-        # Darwin debugserver translates some signals like SIGSEGV into some gdb expectations about fixed signal numbers.
+        # Darwin debugserver translates some signals like SIGSEGV into some gdb
+        # expectations about fixed signal numbers.
         self.Hc_then_Csignal_signals_correct_thread(self.TARGET_EXC_BAD_ACCESS)
 
     @llgs_test
@@ -756,29 +788,35 @@ class LldbGdbServerTestCase(gdbremote_te
         self.init_llgs_test()
         self.build()
         self.set_inferior_startup_launch()
-        self.Hc_then_Csignal_signals_correct_thread(lldbutil.get_signal_number('SIGSEGV'))
+        self.Hc_then_Csignal_signals_correct_thread(
+            lldbutil.get_signal_number('SIGSEGV'))
 
     def m_packet_reads_memory(self):
-        # This is the memory we will write into the inferior and then ensure we can read back with $m.
+        # This is the memory we will write into the inferior and then ensure we
+        # can read back with $m.
         MEMORY_CONTENTS = "Test contents 0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz"
 
         # Start up the inferior.
         procs = self.prep_debug_monitor_and_inferior(
-            inferior_args=["set-message:%s" % MEMORY_CONTENTS, "get-data-address-hex:g_message", "sleep:5"])
+            inferior_args=[
+                "set-message:%s" %
+                MEMORY_CONTENTS,
+                "get-data-address-hex:g_message",
+                "sleep:5"])
 
         # Run the process
         self.test_sequence.add_log_lines(
             [
-             # Start running after initial stop.
-             "read packet: $c#63",
-             # Match output line that prints the memory address of the message buffer within the inferior. 
-             # Note we require launch-only testing so we can get inferior otuput.
-             { "type":"output_match", "regex":self.maybe_strict_output_regex(r"data address: 0x([0-9a-fA-F]+)\r\n"),
-               "capture":{ 1:"message_address"} },
-             # Now stop the inferior.
-             "read packet: {}".format(chr(3)),
-             # And wait for the stop notification.
-             {"direction":"send", "regex":r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);", "capture":{1:"stop_signo", 2:"stop_thread_id"} }],
+                # Start running after initial stop.
+                "read packet: $c#63",
+                # Match output line that prints the memory address of the message buffer within the inferior.
+                # Note we require launch-only testing so we can get inferior otuput.
+                {"type": "output_match", "regex": self.maybe_strict_output_regex(r"data address: 0x([0-9a-fA-F]+)\r\n"),
+                 "capture": {1: "message_address"}},
+                # Now stop the inferior.
+                "read packet: {}".format(chr(3)),
+                # And wait for the stop notification.
+                {"direction": "send", "regex": r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);", "capture": {1: "stop_signo", 2: "stop_thread_id"}}],
             True)
 
         # Run the packet stream.
@@ -793,7 +831,7 @@ class LldbGdbServerTestCase(gdbremote_te
         self.reset_test_sequence()
         self.test_sequence.add_log_lines(
             ["read packet: $m{0:x},{1:x}#00".format(message_address, len(MEMORY_CONTENTS)),
-             {"direction":"send", "regex":r"^\$(.+)#[0-9a-fA-F]{2}$", "capture":{1:"read_contents"} }],
+             {"direction": "send", "regex": r"^\$(.+)#[0-9a-fA-F]{2}$", "capture": {1: "read_contents"}}],
             True)
 
         # Run the packet stream.
@@ -852,16 +890,16 @@ class LldbGdbServerTestCase(gdbremote_te
         # Run the process
         self.test_sequence.add_log_lines(
             [
-             # Start running after initial stop.
-             "read packet: $c#63",
-             # Match output line that prints the memory address of the message buffer within the inferior. 
-             # Note we require launch-only testing so we can get inferior otuput.
-             { "type":"output_match", "regex":self.maybe_strict_output_regex(r"code address: 0x([0-9a-fA-F]+)\r\n"),
-               "capture":{ 1:"code_address"} },
-             # Now stop the inferior.
-             "read packet: {}".format(chr(3)),
-             # And wait for the stop notification.
-             {"direction":"send", "regex":r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);", "capture":{1:"stop_signo", 2:"stop_thread_id"} }],
+                # Start running after initial stop.
+                "read packet: $c#63",
+                # Match output line that prints the memory address of the message buffer within the inferior.
+                # Note we require launch-only testing so we can get inferior otuput.
+                {"type": "output_match", "regex": self.maybe_strict_output_regex(r"code address: 0x([0-9a-fA-F]+)\r\n"),
+                 "capture": {1: "code_address"}},
+                # Now stop the inferior.
+                "read packet: {}".format(chr(3)),
+                # And wait for the stop notification.
+                {"direction": "send", "regex": r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);", "capture": {1: "stop_signo", 2: "stop_thread_id"}}],
             True)
 
         # Run the packet stream.
@@ -893,7 +931,8 @@ class LldbGdbServerTestCase(gdbremote_te
         self.assert_address_within_memory_region(code_address, mem_region_dict)
 
     @debugserver_test
-    def test_qMemoryRegionInfo_reports_code_address_as_executable_debugserver(self):
+    def test_qMemoryRegionInfo_reports_code_address_as_executable_debugserver(
+            self):
         self.init_debugserver_test()
         self.build()
         self.set_inferior_startup_launch()
@@ -914,16 +953,16 @@ class LldbGdbServerTestCase(gdbremote_te
         # Run the process
         self.test_sequence.add_log_lines(
             [
-             # Start running after initial stop.
-             "read packet: $c#63",
-             # Match output line that prints the memory address of the message buffer within the inferior. 
-             # Note we require launch-only testing so we can get inferior otuput.
-             { "type":"output_match", "regex":self.maybe_strict_output_regex(r"stack address: 0x([0-9a-fA-F]+)\r\n"),
-               "capture":{ 1:"stack_address"} },
-             # Now stop the inferior.
-             "read packet: {}".format(chr(3)),
-             # And wait for the stop notification.
-             {"direction":"send", "regex":r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);", "capture":{1:"stop_signo", 2:"stop_thread_id"} }],
+                # Start running after initial stop.
+                "read packet: $c#63",
+                # Match output line that prints the memory address of the message buffer within the inferior.
+                # Note we require launch-only testing so we can get inferior otuput.
+                {"type": "output_match", "regex": self.maybe_strict_output_regex(r"stack address: 0x([0-9a-fA-F]+)\r\n"),
+                 "capture": {1: "stack_address"}},
+                # Now stop the inferior.
+                "read packet: {}".format(chr(3)),
+                # And wait for the stop notification.
+                {"direction": "send", "regex": r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);", "capture": {1: "stop_signo", 2: "stop_thread_id"}}],
             True)
 
         # Run the packet stream.
@@ -952,17 +991,20 @@ class LldbGdbServerTestCase(gdbremote_te
         self.assertTrue("w" in mem_region_dict["permissions"])
 
         # Ensure the start address and size encompass the address we queried.
-        self.assert_address_within_memory_region(stack_address, mem_region_dict)
+        self.assert_address_within_memory_region(
+            stack_address, mem_region_dict)
 
     @debugserver_test
-    def test_qMemoryRegionInfo_reports_stack_address_as_readable_writeable_debugserver(self):
+    def test_qMemoryRegionInfo_reports_stack_address_as_readable_writeable_debugserver(
+            self):
         self.init_debugserver_test()
         self.build()
         self.set_inferior_startup_launch()
         self.qMemoryRegionInfo_reports_stack_address_as_readable_writeable()
 
     @llgs_test
-    def test_qMemoryRegionInfo_reports_stack_address_as_readable_writeable_llgs(self):
+    def test_qMemoryRegionInfo_reports_stack_address_as_readable_writeable_llgs(
+            self):
         self.init_llgs_test()
         self.build()
         self.set_inferior_startup_launch()
@@ -976,16 +1018,16 @@ class LldbGdbServerTestCase(gdbremote_te
         # Run the process
         self.test_sequence.add_log_lines(
             [
-             # Start running after initial stop.
-             "read packet: $c#63",
-             # Match output line that prints the memory address of the message buffer within the inferior. 
-             # Note we require launch-only testing so we can get inferior otuput.
-             { "type":"output_match", "regex":self.maybe_strict_output_regex(r"heap address: 0x([0-9a-fA-F]+)\r\n"),
-               "capture":{ 1:"heap_address"} },
-             # Now stop the inferior.
-             "read packet: {}".format(chr(3)),
-             # And wait for the stop notification.
-             {"direction":"send", "regex":r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);", "capture":{1:"stop_signo", 2:"stop_thread_id"} }],
+                # Start running after initial stop.
+                "read packet: $c#63",
+                # Match output line that prints the memory address of the message buffer within the inferior.
+                # Note we require launch-only testing so we can get inferior otuput.
+                {"type": "output_match", "regex": self.maybe_strict_output_regex(r"heap address: 0x([0-9a-fA-F]+)\r\n"),
+                 "capture": {1: "heap_address"}},
+                # Now stop the inferior.
+                "read packet: {}".format(chr(3)),
+                # And wait for the stop notification.
+                {"direction": "send", "regex": r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);", "capture": {1: "stop_signo", 2: "stop_thread_id"}}],
             True)
 
         # Run the packet stream.
@@ -1016,16 +1058,17 @@ class LldbGdbServerTestCase(gdbremote_te
         # Ensure the start address and size encompass the address we queried.
         self.assert_address_within_memory_region(heap_address, mem_region_dict)
 
-
     @debugserver_test
-    def test_qMemoryRegionInfo_reports_heap_address_as_readable_writeable_debugserver(self):
+    def test_qMemoryRegionInfo_reports_heap_address_as_readable_writeable_debugserver(
+            self):
         self.init_debugserver_test()
         self.build()
         self.set_inferior_startup_launch()
         self.qMemoryRegionInfo_reports_heap_address_as_readable_writeable()
 
     @llgs_test
-    def test_qMemoryRegionInfo_reports_heap_address_as_readable_writeable_llgs(self):
+    def test_qMemoryRegionInfo_reports_heap_address_as_readable_writeable_llgs(
+            self):
         self.init_llgs_test()
         self.build()
         self.set_inferior_startup_launch()
@@ -1034,29 +1077,33 @@ class LldbGdbServerTestCase(gdbremote_te
     def software_breakpoint_set_and_remove_work(self):
         # Start up the inferior.
         procs = self.prep_debug_monitor_and_inferior(
-            inferior_args=["get-code-address-hex:hello", "sleep:1", "call-function:hello"])
+            inferior_args=[
+                "get-code-address-hex:hello",
+                "sleep:1",
+                "call-function:hello"])
 
         # Run the process
         self.add_register_info_collection_packets()
         self.add_process_info_collection_packets()
         self.test_sequence.add_log_lines(
-            [# Start running after initial stop.
-             "read packet: $c#63",
-             # Match output line that prints the memory address of the function call entry point.
-             # Note we require launch-only testing so we can get inferior otuput.
-             { "type":"output_match", "regex":self.maybe_strict_output_regex(r"code address: 0x([0-9a-fA-F]+)\r\n"),
-               "capture":{ 1:"function_address"} },
-             # Now stop the inferior.
-             "read packet: {}".format(chr(3)),
-             # And wait for the stop notification.
-             {"direction":"send", "regex":r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);", "capture":{1:"stop_signo", 2:"stop_thread_id"} }],
+            [  # Start running after initial stop.
+                "read packet: $c#63",
+                # Match output line that prints the memory address of the function call entry point.
+                # Note we require launch-only testing so we can get inferior otuput.
+                {"type": "output_match", "regex": self.maybe_strict_output_regex(r"code address: 0x([0-9a-fA-F]+)\r\n"),
+                 "capture": {1: "function_address"}},
+                # Now stop the inferior.
+                "read packet: {}".format(chr(3)),
+                # And wait for the stop notification.
+                {"direction": "send", "regex": r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);", "capture": {1: "stop_signo", 2: "stop_thread_id"}}],
             True)
 
         # Run the packet stream.
         context = self.expect_gdbremote_sequence()
         self.assertIsNotNone(context)
 
-        # Gather process info - we need endian of target to handle register value conversions.
+        # Gather process info - we need endian of target to handle register
+        # value conversions.
         process_info = self.parse_process_info_response(context)
         endian = process_info.get("endian")
         self.assertIsNotNone(endian)
@@ -1078,7 +1125,10 @@ class LldbGdbServerTestCase(gdbremote_te
         else:
             BREAKPOINT_KIND = 1
         self.reset_test_sequence()
-        self.add_set_breakpoint_packets(function_address, do_continue=True, breakpoint_kind=BREAKPOINT_KIND)
+        self.add_set_breakpoint_packets(
+            function_address,
+            do_continue=True,
+            breakpoint_kind=BREAKPOINT_KIND)
 
         # Run the packet stream.
         context = self.expect_gdbremote_sequence()
@@ -1087,7 +1137,8 @@ class LldbGdbServerTestCase(gdbremote_te
         # Verify the stop signal reported was the breakpoint signal number.
         stop_signo = context.get("stop_signo")
         self.assertIsNotNone(stop_signo)
-        self.assertEqual(int(stop_signo,16), lldbutil.get_signal_number('SIGTRAP'))
+        self.assertEqual(int(stop_signo, 16),
+                         lldbutil.get_signal_number('SIGTRAP'))
 
         # Ensure we did not receive any output.  If the breakpoint was not set, we would
         # see output (from a launched process with captured stdio) printing a hello, world message.
@@ -1099,37 +1150,43 @@ class LldbGdbServerTestCase(gdbremote_te
         self.reset_test_sequence()
         self.test_sequence.add_log_lines(
             [
-             # Print the PC.  This should match the breakpoint address.
-             "read packet: $p{0:x}#00".format(pc_lldb_reg_index),
-             # Capture $p results.
-             { "direction":"send", "regex":r"^\$([0-9a-fA-F]+)#", "capture":{1:"p_response"} },
-             ], True)
- 
+                # Print the PC.  This should match the breakpoint address.
+                "read packet: $p{0:x}#00".format(pc_lldb_reg_index),
+                # Capture $p results.
+                {"direction": "send",
+                 "regex": r"^\$([0-9a-fA-F]+)#",
+                 "capture": {1: "p_response"}},
+            ], True)
+
         context = self.expect_gdbremote_sequence()
         self.assertIsNotNone(context)
-         
-        # Verify the PC is where we expect.  Note response is in endianness of the inferior.
+
+        # Verify the PC is where we expect.  Note response is in endianness of
+        # the inferior.
         p_response = context.get("p_response")
         self.assertIsNotNone(p_response)
 
         # Convert from target endian to int.
-        returned_pc = lldbgdbserverutils.unpack_register_hex_unsigned(endian, p_response)
+        returned_pc = lldbgdbserverutils.unpack_register_hex_unsigned(
+            endian, p_response)
         self.assertEqual(returned_pc, function_address)
 
-        # Verify that a breakpoint remove and continue gets us the expected output.
+        # Verify that a breakpoint remove and continue gets us the expected
+        # output.
         self.reset_test_sequence()
         self.test_sequence.add_log_lines(
             [
-            # Remove the breakpoint.
-            "read packet: $z0,{0:x},{1}#00".format(function_address, BREAKPOINT_KIND),
-            # Verify the stub could unset it.
-            "send packet: $OK#00",
-            # Continue running.
-            "read packet: $c#63",
-            # We should now receive the output from the call.
-            { "type":"output_match", "regex":r"^hello, world\r\n$" },
-            # And wait for program completion.
-            {"direction":"send", "regex":r"^\$W00(.*)#[0-9a-fA-F]{2}$" },
+                # Remove the breakpoint.
+                "read packet: $z0,{0:x},{1}#00".format(
+                    function_address, BREAKPOINT_KIND),
+                # Verify the stub could unset it.
+                "send packet: $OK#00",
+                # Continue running.
+                "read packet: $c#63",
+                # We should now receive the output from the call.
+                {"type": "output_match", "regex": r"^hello, world\r\n$"},
+                # And wait for program completion.
+                {"direction": "send", "regex": r"^\$W00(.*)#[0-9a-fA-F]{2}$"},
             ], True)
 
         context = self.expect_gdbremote_sequence()
@@ -1190,19 +1247,24 @@ class LldbGdbServerTestCase(gdbremote_te
         TEST_MESSAGE = "Hello, memory"
 
         # Start up the stub and start/prep the inferior.
-        procs = self.prep_debug_monitor_and_inferior(inferior_args=["set-message:xxxxxxxxxxxxxX", "get-data-address-hex:g_message", "sleep:1", "print-message:"])
+        procs = self.prep_debug_monitor_and_inferior(
+            inferior_args=[
+                "set-message:xxxxxxxxxxxxxX",
+                "get-data-address-hex:g_message",
+                "sleep:1",
+                "print-message:"])
         self.test_sequence.add_log_lines(
             [
-             # Start running after initial stop.
-             "read packet: $c#63",
-             # Match output line that prints the memory address of the message buffer within the inferior. 
-             # Note we require launch-only testing so we can get inferior otuput.
-             { "type":"output_match", "regex":self.maybe_strict_output_regex(r"data address: 0x([0-9a-fA-F]+)\r\n"),
-               "capture":{ 1:"message_address"} },
-             # Now stop the inferior.
-             "read packet: {}".format(chr(3)),
-             # And wait for the stop notification.
-             {"direction":"send", "regex":r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);", "capture":{1:"stop_signo", 2:"stop_thread_id"} }],
+                # Start running after initial stop.
+                "read packet: $c#63",
+                # Match output line that prints the memory address of the message buffer within the inferior.
+                # Note we require launch-only testing so we can get inferior otuput.
+                {"type": "output_match", "regex": self.maybe_strict_output_regex(r"data address: 0x([0-9a-fA-F]+)\r\n"),
+                 "capture": {1: "message_address"}},
+                # Now stop the inferior.
+                "read packet: {}".format(chr(3)),
+                # And wait for the stop notification.
+                {"direction": "send", "regex": r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);", "capture": {1: "stop_signo", 2: "stop_thread_id"}}],
             True)
         context = self.expect_gdbremote_sequence()
         self.assertIsNotNone(context)
@@ -1229,9 +1291,9 @@ class LldbGdbServerTestCase(gdbremote_te
              "read packet: $x{0:x},4#00".format(message_address),
              "send packet: ${0}#00".format(TEST_MESSAGE[0:4]),
              "read packet: $c#63",
-             { "type":"output_match", "regex":r"^message: (.+)\r\n$", "capture":{ 1:"printed_message"} },
+             {"type": "output_match", "regex": r"^message: (.+)\r\n$", "capture": {1: "printed_message"}},
              "send packet: $W00#00",
-            ], True)
+             ], True)
         context = self.expect_gdbremote_sequence()
         self.assertIsNotNone(context)
 
@@ -1274,17 +1336,21 @@ class LldbGdbServerTestCase(gdbremote_te
         endian = process_info.get("endian")
         self.assertIsNotNone(endian)
 
-        # Pull out the register infos that we think we can bit flip successfully,.
-        gpr_reg_infos = [reg_info for reg_info in reg_infos if self.is_bit_flippable_register(reg_info)]
+        # Pull out the register infos that we think we can bit flip
+        # successfully,.
+        gpr_reg_infos = [
+            reg_info for reg_info in reg_infos if self.is_bit_flippable_register(reg_info)]
         self.assertTrue(len(gpr_reg_infos) > 0)
 
         # Write flipped bit pattern of existing value to each register.
-        (successful_writes, failed_writes) = self.flip_all_bits_in_each_register_value(gpr_reg_infos, endian)
+        (successful_writes, failed_writes) = self.flip_all_bits_in_each_register_value(
+            gpr_reg_infos, endian)
         # print("successful writes: {}, failed writes: {}".format(successful_writes, failed_writes))
         self.assertTrue(successful_writes > 0)
 
     # Note: as of this moment, a hefty number of the GPR writes are failing with E32 (everything except rax-rdx, rdi, rsi, rbp).
-    # Come back to this.  I have the test rigged to verify that at least some of the bit-flip writes work.
+    # Come back to this.  I have the test rigged to verify that at least some
+    # of the bit-flip writes work.
     @debugserver_test
     def test_P_writes_all_gpr_registers_debugserver(self):
         self.init_debugserver_test()
@@ -1301,7 +1367,8 @@ class LldbGdbServerTestCase(gdbremote_te
 
     def P_and_p_thread_suffix_work(self):
         # Startup the inferior with three threads.
-        procs = self.prep_debug_monitor_and_inferior(inferior_args=["thread:new", "thread:new"])
+        procs = self.prep_debug_monitor_and_inferior(
+            inferior_args=["thread:new", "thread:new"])
         self.add_thread_suffix_request_packets()
         self.add_register_info_collection_packets()
         self.add_process_info_collection_packets()
@@ -1323,7 +1390,8 @@ class LldbGdbServerTestCase(gdbremote_te
         reg_byte_size = int(reg_infos[reg_index]["bitsize"]) / 8
         self.assertTrue(reg_byte_size > 0)
 
-        # Run the process a bit so threads can start up, and collect register info.
+        # Run the process a bit so threads can start up, and collect register
+        # info.
         context = self.run_process_then_stop(run_seconds=1)
         self.assertIsNotNone(context)
 
@@ -1338,59 +1406,75 @@ class LldbGdbServerTestCase(gdbremote_te
         # Set the same register in each of 3 threads to a different value.
         # Verify each one has the unique value.
         for thread in threads:
-            # If we don't have a next value yet, start it with the initial read value + 1
+            # If we don't have a next value yet, start it with the initial read
+            # value + 1
             if not next_value:
                 # Read pre-existing register value.
                 self.reset_test_sequence()
                 self.test_sequence.add_log_lines(
                     ["read packet: $p{0:x};thread:{1:x}#00".format(reg_index, thread),
-                     { "direction":"send", "regex":r"^\$([0-9a-fA-F]+)#", "capture":{1:"p_response"} },
-                    ], True)
+                     {"direction": "send", "regex": r"^\$([0-9a-fA-F]+)#", "capture": {1: "p_response"}},
+                     ], True)
                 context = self.expect_gdbremote_sequence()
                 self.assertIsNotNone(context)
 
-                # Set the next value to use for writing as the increment plus current value.
+                # Set the next value to use for writing as the increment plus
+                # current value.
                 p_response = context.get("p_response")
                 self.assertIsNotNone(p_response)
-                next_value = lldbgdbserverutils.unpack_register_hex_unsigned(endian, p_response)
+                next_value = lldbgdbserverutils.unpack_register_hex_unsigned(
+                    endian, p_response)
 
             # Set new value using P and thread suffix.
             self.reset_test_sequence()
             self.test_sequence.add_log_lines(
-                ["read packet: $P{0:x}={1};thread:{2:x}#00".format(reg_index, lldbgdbserverutils.pack_register_hex(endian, next_value, byte_size=reg_byte_size), thread),
-                 "send packet: $OK#00",
-                ], True)
+                [
+                    "read packet: $P{0:x}={1};thread:{2:x}#00".format(
+                        reg_index,
+                        lldbgdbserverutils.pack_register_hex(
+                            endian,
+                            next_value,
+                            byte_size=reg_byte_size),
+                        thread),
+                    "send packet: $OK#00",
+                ],
+                True)
             context = self.expect_gdbremote_sequence()
             self.assertIsNotNone(context)
 
             # Save the value we set.
             expected_reg_values.append(next_value)
 
-            # Increment value for next thread to use (we want them all different so we can verify they wrote to each thread correctly next.)
+            # Increment value for next thread to use (we want them all
+            # different so we can verify they wrote to each thread correctly
+            # next.)
             next_value += register_increment
 
-        # Revisit each thread and verify they have the expected value set for the register we wrote.
+        # Revisit each thread and verify they have the expected value set for
+        # the register we wrote.
         thread_index = 0
         for thread in threads:
             # Read pre-existing register value.
             self.reset_test_sequence()
             self.test_sequence.add_log_lines(
                 ["read packet: $p{0:x};thread:{1:x}#00".format(reg_index, thread),
-                 { "direction":"send", "regex":r"^\$([0-9a-fA-F]+)#", "capture":{1:"p_response"} },
-                ], True)
+                 {"direction": "send", "regex": r"^\$([0-9a-fA-F]+)#", "capture": {1: "p_response"}},
+                 ], True)
             context = self.expect_gdbremote_sequence()
             self.assertIsNotNone(context)
 
             # Get the register value.
             p_response = context.get("p_response")
             self.assertIsNotNone(p_response)
-            read_value = lldbgdbserverutils.unpack_register_hex_unsigned(endian, p_response)
+            read_value = lldbgdbserverutils.unpack_register_hex_unsigned(
+                endian, p_response)
 
             # Make sure we read back what we wrote.
             self.assertEqual(read_value, expected_reg_values[thread_index])
             thread_index += 1
 
-    # Note: as of this moment, a hefty number of the GPR writes are failing with E32 (everything except rax-rdx, rdi, rsi, rbp).
+    # Note: as of this moment, a hefty number of the GPR writes are failing
+    # with E32 (everything except rax-rdx, rdi, rsi, rbp).
     @debugserver_test
     def test_P_and_p_thread_suffix_work_debugserver(self):
         self.init_debugserver_test()

Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubReverseConnect.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubReverseConnect.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubReverseConnect.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubReverseConnect.py Tue Sep  6 15:57:50 2016
@@ -10,6 +10,7 @@ from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
+
 class TestStubReverseConnect(gdbremote_testcase.GdbRemoteTestCaseBase):
 
     mydir = TestBase.compute_mydir(__file__)
@@ -30,7 +31,7 @@ class TestStubReverseConnect(gdbremote_t
         self.assertIsNotNone(sock)
 
         sock.settimeout(timeout_seconds)
-        sock.bind(("127.0.0.1",0))
+        sock.bind(("127.0.0.1", 0))
         sock.listen(1)
 
         def tear_down_listener():
@@ -56,18 +57,25 @@ class TestStubReverseConnect(gdbremote_t
 
         triple = self.dbg.GetSelectedPlatform().GetTriple()
         if re.match(".*-.*-.*-android", triple):
-            self.forward_adb_port(self.port, self.port, "reverse", self.stub_device)
+            self.forward_adb_port(
+                self.port,
+                self.port,
+                "reverse",
+                self.stub_device)
 
         # Start the stub.
         server = self.launch_debug_monitor(logfile=sys.stdout)
         self.assertIsNotNone(server)
-        self.assertTrue(lldbgdbserverutils.process_is_running(server.pid, True))
+        self.assertTrue(
+            lldbgdbserverutils.process_is_running(
+                server.pid, True))
 
         # Listen for the stub's connection to us.
         (stub_socket, address) = self.listener_socket.accept()
         self.assertIsNotNone(stub_socket)
         self.assertIsNotNone(address)
-        print("connected to stub {} on {}".format(address, stub_socket.getsockname()))
+        print("connected to stub {} on {}".format(
+            address, stub_socket.getsockname()))
 
         # Verify we can do the handshake.  If that works, we'll call it good.
         self.do_handshake(stub_socket, timeout_seconds=self._DEFAULT_TIMEOUT)
@@ -82,7 +90,7 @@ class TestStubReverseConnect(gdbremote_t
         self.reverse_connect_works()
 
     @llgs_test
-    @skipIfRemote # reverse connect is not a supported use case for now
+    @skipIfRemote  # reverse connect is not a supported use case for now
     def test_reverse_connect_works_llgs(self):
         self.init_llgs_test(use_named_pipe=False)
         self.set_inferior_startup_launch()

Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubSetSID.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubSetSID.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubSetSID.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubSetSID.py Tue Sep  6 15:57:50 2016
@@ -1,7 +1,6 @@
 from __future__ import print_function
 
 
-
 import gdbremote_testcase
 import lldbgdbserverutils
 import os
@@ -12,6 +11,7 @@ from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
+
 class TestStubSetSIDTestCase(gdbremote_testcase.GdbRemoteTestCaseBase):
 
     mydir = TestBase.compute_mydir(__file__)
@@ -23,7 +23,9 @@ class TestStubSetSIDTestCase(gdbremote_t
 
         server = self.launch_debug_monitor()
         self.assertIsNotNone(server)
-        self.assertTrue(lldbgdbserverutils.process_is_running(server.pid, True))
+        self.assertTrue(
+            lldbgdbserverutils.process_is_running(
+                server.pid, True))
 
         # Get the process id for the stub.
         return os.getsid(server.pid)
@@ -41,14 +43,14 @@ class TestStubSetSIDTestCase(gdbremote_t
         self.assertNotEqual(stub_sid, os.getsid(0))
 
     @debugserver_test
-    @skipIfRemote # --setsid not used on remote platform and currently it is also impossible to get the sid of lldb-platform running on a remote target
+    @skipIfRemote  # --setsid not used on remote platform and currently it is also impossible to get the sid of lldb-platform running on a remote target
     def test_sid_is_same_without_setsid_debugserver(self):
         self.init_debugserver_test()
         self.set_inferior_startup_launch()
         self.sid_is_same_without_setsid()
 
     @llgs_test
-    @skipIfRemote # --setsid not used on remote platform and currently it is also impossible to get the sid of lldb-platform running on a remote target
+    @skipIfRemote  # --setsid not used on remote platform and currently it is also impossible to get the sid of lldb-platform running on a remote target
     @expectedFailureAll(oslist=['freebsd'])
     def test_sid_is_same_without_setsid_llgs(self):
         self.init_llgs_test()
@@ -56,28 +58,28 @@ class TestStubSetSIDTestCase(gdbremote_t
         self.sid_is_same_without_setsid()
 
     @debugserver_test
-    @skipIfRemote # --setsid not used on remote platform and currently it is also impossible to get the sid of lldb-platform running on a remote target
+    @skipIfRemote  # --setsid not used on remote platform and currently it is also impossible to get the sid of lldb-platform running on a remote target
     def test_sid_is_different_with_setsid_debugserver(self):
         self.init_debugserver_test()
         self.set_inferior_startup_launch()
         self.sid_is_different_with_setsid()
 
     @llgs_test
-    @skipIfRemote # --setsid not used on remote platform and currently it is also impossible to get the sid of lldb-platform running on a remote target
+    @skipIfRemote  # --setsid not used on remote platform and currently it is also impossible to get the sid of lldb-platform running on a remote target
     def test_sid_is_different_with_setsid_llgs(self):
         self.init_llgs_test()
         self.set_inferior_startup_launch()
         self.sid_is_different_with_setsid()
 
     @debugserver_test
-    @skipIfRemote # --setsid not used on remote platform and currently it is also impossible to get the sid of lldb-platform running on a remote target
+    @skipIfRemote  # --setsid not used on remote platform and currently it is also impossible to get the sid of lldb-platform running on a remote target
     def test_sid_is_different_with_S_debugserver(self):
         self.init_debugserver_test()
         self.set_inferior_startup_launch()
         self.sid_is_different_with_S()
 
     @llgs_test
-    @skipIfRemote # --setsid not used on remote platform and currently it is also impossible to get the sid of lldb-platform running on a remote target
+    @skipIfRemote  # --setsid not used on remote platform and currently it is also impossible to get the sid of lldb-platform running on a remote target
     def test_sid_is_different_with_S_llgs(self):
         self.init_llgs_test()
         self.set_inferior_startup_launch()

Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py Tue Sep  6 15:57:50 2016
@@ -5,7 +5,6 @@ Base class for gdb-remote test cases.
 from __future__ import print_function
 
 
-
 import errno
 import os
 import os.path
@@ -24,9 +23,11 @@ from lldbsuite.test.lldbtest import *
 from lldbgdbserverutils import *
 import logging
 
+
 class _ConnectionRefused(IOError):
     pass
 
+
 class GdbRemoteTestCaseBase(TestBase):
 
     NO_DEBUG_INFO_TESTCASE = True
@@ -35,29 +36,34 @@ class GdbRemoteTestCaseBase(TestBase):
 
     _GDBREMOTE_KILL_PACKET = "$k#6b"
 
-    # Start the inferior separately, attach to the inferior on the stub command line.
+    # Start the inferior separately, attach to the inferior on the stub
+    # command line.
     _STARTUP_ATTACH = "attach"
-    # Start the inferior separately, start the stub without attaching, allow the test to attach to the inferior however it wants (e.g. $vAttach;pid).
+    # Start the inferior separately, start the stub without attaching, allow
+    # the test to attach to the inferior however it wants (e.g. $vAttach;pid).
     _STARTUP_ATTACH_MANUALLY = "attach_manually"
-    # Start the stub, and launch the inferior with an $A packet via the initial packet stream.
+    # Start the stub, and launch the inferior with an $A packet via the
+    # initial packet stream.
     _STARTUP_LAUNCH = "launch"
 
-    # GDB Signal numbers that are not target-specific used for common exceptions
-    TARGET_EXC_BAD_ACCESS      = 0x91
+    # GDB Signal numbers that are not target-specific used for common
+    # exceptions
+    TARGET_EXC_BAD_ACCESS = 0x91
     TARGET_EXC_BAD_INSTRUCTION = 0x92
-    TARGET_EXC_ARITHMETIC      = 0x93
-    TARGET_EXC_EMULATION       = 0x94
-    TARGET_EXC_SOFTWARE        = 0x95
-    TARGET_EXC_BREAKPOINT      = 0x96
+    TARGET_EXC_ARITHMETIC = 0x93
+    TARGET_EXC_EMULATION = 0x94
+    TARGET_EXC_SOFTWARE = 0x95
+    TARGET_EXC_BREAKPOINT = 0x96
 
     _verbose_log_handler = None
-    _log_formatter = logging.Formatter(fmt='%(asctime)-15s %(levelname)-8s %(message)s')
+    _log_formatter = logging.Formatter(
+        fmt='%(asctime)-15s %(levelname)-8s %(message)s')
 
     def setUpBaseLogging(self):
         self.logger = logging.getLogger(__name__)
 
         if len(self.logger.handlers) > 0:
-            return # We have set up this handler already
+            return  # We have set up this handler already
 
         self.logger.propagate = False
         self.logger.setLevel(logging.DEBUG)
@@ -68,11 +74,11 @@ class GdbRemoteTestCaseBase(TestBase):
         handler.setFormatter(self._log_formatter)
         self.logger.addHandler(handler)
 
-
     def isVerboseLoggingRequested(self):
         # We will report our detailed logs if the user requested that the "gdb-remote" channel is
         # logged.
-        return any(("gdb-remote" in channel) for channel in lldbtest_config.channels)
+        return any(("gdb-remote" in channel)
+                   for channel in lldbtest_config.channels)
 
     def setUp(self):
         TestBase.setUp(self)
@@ -83,7 +89,8 @@ class GdbRemoteTestCaseBase(TestBase):
 
         if self.isVerboseLoggingRequested():
             # If requested, full logs go to a log file
-            self._verbose_log_handler = logging.FileHandler(self.log_basename + "-host.log")
+            self._verbose_log_handler = logging.FileHandler(
+                self.log_basename + "-host.log")
             self._verbose_log_handler.setFormatter(self._log_formatter)
             self._verbose_log_handler.setLevel(logging.DEBUG)
             self.logger.addHandler(self._verbose_log_handler)
@@ -100,7 +107,8 @@ class GdbRemoteTestCaseBase(TestBase):
                 url_pattern = '(.+)://\[?(.+?)\]?/.*'
             else:
                 url_pattern = '(.+)://(.+):\d+'
-            scheme, host = re.match(url_pattern, configuration.lldb_platform_url).groups()
+            scheme, host = re.match(
+                url_pattern, configuration.lldb_platform_url).groups()
             if configuration.lldb_platform_name == 'remote-android' and host != 'localhost':
                 self.stub_device = host
                 self.stub_hostname = 'localhost'
@@ -122,21 +130,24 @@ class GdbRemoteTestCaseBase(TestBase):
 
     def setUpServerLogging(self, is_llgs):
         if len(lldbtest_config.channels) == 0:
-            return # No logging requested
+            return  # No logging requested
 
         if lldb.remote_platform:
-            log_file = lldbutil.join_remote_paths(lldb.remote_platform.GetWorkingDirectory(), "server.log")
+            log_file = lldbutil.join_remote_paths(
+                lldb.remote_platform.GetWorkingDirectory(), "server.log")
         else:
             log_file = self.getLocalServerLogFile()
 
         if is_llgs:
             self.debug_monitor_extra_args.append("--log-file=" + log_file)
-            self.debug_monitor_extra_args.append("--log-channels={}".format(":".join(lldbtest_config.channels)))
+            self.debug_monitor_extra_args.append(
+                "--log-channels={}".format(":".join(lldbtest_config.channels)))
         else:
-            self.debug_monitor_extra_args = ["--log-file=" + log_file, "--log-flags=0x800000"]
+            self.debug_monitor_extra_args = [
+                "--log-file=" + log_file, "--log-flags=0x800000"]
 
     def get_next_port(self):
-        return 12000 + random.randint(0,3999)
+        return 12000 + random.randint(0, 3999)
 
     def reset_test_sequence(self):
         self.test_sequence = GdbRemoteTestSequence(self.logger)
@@ -149,7 +160,8 @@ class GdbRemoteTestCaseBase(TestBase):
         # Create the named pipe.
         os.mkfifo(named_pipe_path)
 
-        # Open the read side of the pipe in non-blocking mode.  This will return right away, ready or not.
+        # Open the read side of the pipe in non-blocking mode.  This will
+        # return right away, ready or not.
         named_pipe_fd = os.open(named_pipe_path, os.O_RDONLY | os.O_NONBLOCK)
 
         # Create the file for the named pipe.  Note this will follow semantics of
@@ -177,7 +189,9 @@ class GdbRemoteTestCaseBase(TestBase):
             try:
                 os.rmdir(temp_dir)
             except:
-                print("failed to delete temp dir: {}, directory contents: '{}'".format(temp_dir, os.listdir(temp_dir)))
+                print(
+                    "failed to delete temp dir: {}, directory contents: '{}'".format(
+                        temp_dir, os.listdir(temp_dir)))
                 None
 
         # Add the shutdown hook to clean up the named pipe.
@@ -190,14 +204,23 @@ class GdbRemoteTestCaseBase(TestBase):
 
     def get_stub_port_from_named_socket(self, read_timeout_seconds=5):
         # Wait for something to read with a max timeout.
-        (ready_readers, _, _) = select.select([self.named_pipe_fd], [], [], read_timeout_seconds)
-        self.assertIsNotNone(ready_readers, "write side of pipe has not written anything - stub isn't writing to pipe.")
-        self.assertNotEqual(len(ready_readers), 0, "write side of pipe has not written anything - stub isn't writing to pipe.")
+        (ready_readers, _, _) = select.select(
+            [self.named_pipe_fd], [], [], read_timeout_seconds)
+        self.assertIsNotNone(
+            ready_readers,
+            "write side of pipe has not written anything - stub isn't writing to pipe.")
+        self.assertNotEqual(
+            len(ready_readers),
+            0,
+            "write side of pipe has not written anything - stub isn't writing to pipe.")
 
         # Read the port from the named pipe.
         stub_port_raw = self.named_pipe.read()
         self.assertIsNotNone(stub_port_raw)
-        self.assertNotEqual(len(stub_port_raw), 0, "no content to read on pipe")
+        self.assertNotEqual(
+            len(stub_port_raw),
+            0,
+            "no content to read on pipe")
 
         # Trim null byte, convert to int.
         stub_port_raw = stub_port_raw[:-1]
@@ -212,15 +235,24 @@ class GdbRemoteTestCaseBase(TestBase):
             use_named_pipe = False
 
             # Grab the ppid from /proc/[shell pid]/stat
-            err, retcode, shell_stat = self.run_platform_command("cat /proc/$$/stat")
-            self.assertTrue(err.Success() and retcode == 0,
-                    "Failed to read file /proc/$$/stat: %s, retcode: %d" % (err.GetCString(), retcode))
+            err, retcode, shell_stat = self.run_platform_command(
+                "cat /proc/$$/stat")
+            self.assertTrue(
+                err.Success() and retcode == 0,
+                "Failed to read file /proc/$$/stat: %s, retcode: %d" %
+                (err.GetCString(),
+                 retcode))
 
             # [pid] ([executable]) [state] [*ppid*]
             pid = re.match(r"^\d+ \(.+\) . (\d+)", shell_stat).group(1)
-            err, retcode, ls_output = self.run_platform_command("ls -l /proc/%s/exe" % pid)
-            self.assertTrue(err.Success() and retcode == 0,
-                    "Failed to read file /proc/%s/exe: %s, retcode: %d" % (pid, err.GetCString(), retcode))
+            err, retcode, ls_output = self.run_platform_command(
+                "ls -l /proc/%s/exe" % pid)
+            self.assertTrue(
+                err.Success() and retcode == 0,
+                "Failed to read file /proc/%s/exe: %s, retcode: %d" %
+                (pid,
+                 err.GetCString(),
+                 retcode))
             exe = ls_output.split()[-1]
 
             # If the binary has been deleted, the link name has " (deleted)" appended.
@@ -235,7 +267,8 @@ class GdbRemoteTestCaseBase(TestBase):
         self.setUpServerLogging(is_llgs=True)
 
         if use_named_pipe:
-            (self.named_pipe_path, self.named_pipe, self.named_pipe_fd) = self.create_named_pipe()
+            (self.named_pipe_path, self.named_pipe,
+             self.named_pipe_fd) = self.create_named_pipe()
 
     def init_debugserver_test(self, use_named_pipe=True):
         self.debug_monitor_exe = get_debugserver_exe()
@@ -243,17 +276,19 @@ class GdbRemoteTestCaseBase(TestBase):
             self.skipTest("debugserver exe not found")
         self.setUpServerLogging(is_llgs=False)
         if use_named_pipe:
-            (self.named_pipe_path, self.named_pipe, self.named_pipe_fd) = self.create_named_pipe()
+            (self.named_pipe_path, self.named_pipe,
+             self.named_pipe_fd) = self.create_named_pipe()
         # The debugserver stub has a race on handling the 'k' command, so it sends an X09 right away, then sends the real X notification
         # when the process truly dies.
         self.stub_sends_two_stop_notifications_on_kill = True
 
     def forward_adb_port(self, source, target, direction, device):
-        adb = [ 'adb' ] + ([ '-s', device ] if device else []) + [ direction ]
+        adb = ['adb'] + (['-s', device] if device else []) + [direction]
+
         def remove_port_forward():
-            subprocess.call(adb + [ "--remove", "tcp:%d" % source])
+            subprocess.call(adb + ["--remove", "tcp:%d" % source])
 
-        subprocess.call(adb + [ "tcp:%d" % source, "tcp:%d" % target])
+        subprocess.call(adb + ["tcp:%d" % source, "tcp:%d" % target])
         self.addTearDownHook(remove_port_forward)
 
     def _verify_socket(self, sock):
@@ -265,12 +300,12 @@ class GdbRemoteTestCaseBase(TestBase):
         # connection again.
         triple = self.dbg.GetSelectedPlatform().GetTriple()
         if not re.match(".*-.*-.*-android", triple):
-            return # Not android.
+            return  # Not android.
         can_read, _, _ = select.select([sock], [], [], 0.1)
         if sock not in can_read:
-            return # Data is not available, but the connection is alive.
+            return  # Data is not available, but the connection is alive.
         if len(sock.recv(1, socket.MSG_PEEK)) == 0:
-            raise _ConnectionRefused() # Got EOF, connection dropped.
+            raise _ConnectionRefused()  # Got EOF, connection dropped.
 
     def create_socket(self):
         sock = socket.socket()
@@ -278,9 +313,16 @@ class GdbRemoteTestCaseBase(TestBase):
 
         triple = self.dbg.GetSelectedPlatform().GetTriple()
         if re.match(".*-.*-.*-android", triple):
-            self.forward_adb_port(self.port, self.port, "forward", self.stub_device)
-
-        logger.info("Connecting to debug monitor on %s:%d", self.stub_hostname, self.port)
+            self.forward_adb_port(
+                self.port,
+                self.port,
+                "forward",
+                self.stub_device)
+
+        logger.info(
+            "Connecting to debug monitor on %s:%d",
+            self.stub_hostname,
+            self.port)
         connect_info = (self.stub_hostname, self.port)
         try:
             sock.connect(connect_info)
@@ -295,12 +337,16 @@ class GdbRemoteTestCaseBase(TestBase):
                     # send the kill packet so lldb-server shuts down gracefully
                     sock.sendall(GdbRemoteTestCaseBase._GDBREMOTE_KILL_PACKET)
                 except:
-                    logger.warning("failed to send kill packet to debug monitor: {}; ignoring".format(sys.exc_info()[0]))
+                    logger.warning(
+                        "failed to send kill packet to debug monitor: {}; ignoring".format(
+                            sys.exc_info()[0]))
 
                 try:
                     sock.close()
                 except:
-                    logger.warning("failed to close socket to debug monitor: {}; ignoring".format(sys.exc_info()[0]))
+                    logger.warning(
+                        "failed to close socket to debug monitor: {}; ignoring".format(
+                            sys.exc_info()[0]))
 
         self.addTearDownHook(shutdown_socket)
 
@@ -319,9 +365,11 @@ class GdbRemoteTestCaseBase(TestBase):
 
     def get_debug_monitor_command_line_args(self, attach_pid=None):
         if lldb.remote_platform:
-            commandline_args = self.debug_monitor_extra_args + ["*:{}".format(self.port)]
+            commandline_args = self.debug_monitor_extra_args + \
+                ["*:{}".format(self.port)]
         else:
-            commandline_args = self.debug_monitor_extra_args + ["localhost:{}".format(self.port)]
+            commandline_args = self.debug_monitor_extra_args + \
+                ["localhost:{}".format(self.port)]
 
         if attach_pid:
             commandline_args += ["--attach=%d" % attach_pid]
@@ -331,14 +379,19 @@ class GdbRemoteTestCaseBase(TestBase):
 
     def launch_debug_monitor(self, attach_pid=None, logfile=None):
         # Create the command line.
-        commandline_args = self.get_debug_monitor_command_line_args(attach_pid=attach_pid)
+        commandline_args = self.get_debug_monitor_command_line_args(
+            attach_pid=attach_pid)
 
         # Start the server.
-        server = self.spawnSubprocess(self.debug_monitor_exe, commandline_args, install_remote=False)
+        server = self.spawnSubprocess(
+            self.debug_monitor_exe,
+            commandline_args,
+            install_remote=False)
         self.addTearDownHook(self.cleanupSubprocesses)
         self.assertIsNotNone(server)
 
-        # If we're receiving the stub's listening port from the named pipe, do that here.
+        # If we're receiving the stub's listening port from the named pipe, do
+        # that here.
         if self.named_pipe:
             self.port = self.get_stub_port_from_named_socket()
 
@@ -354,7 +407,9 @@ class GdbRemoteTestCaseBase(TestBase):
                 try:
                     server.terminate()
                 except:
-                    logger.warning("failed to terminate server for debug monitor: {}; ignoring".format(sys.exc_info()[0]))
+                    logger.warning(
+                        "failed to terminate server for debug monitor: {}; ignoring".format(
+                            sys.exc_info()[0]))
             self.addTearDownHook(shutdown_debug_monitor)
 
             # Schedule debug monitor to be shut down during teardown.
@@ -374,11 +429,14 @@ class GdbRemoteTestCaseBase(TestBase):
 
             # Schedule debug monitor to be shut down during teardown.
             logger = self.logger
+
             def shutdown_debug_monitor():
                 try:
                     server.terminate()
                 except:
-                    logger.warning("failed to terminate server for debug monitor: {}; ignoring".format(sys.exc_info()[0]))
+                    logger.warning(
+                        "failed to terminate server for debug monitor: {}; ignoring".format(
+                            sys.exc_info()[0]))
             self.addTearDownHook(shutdown_debug_monitor)
 
             connect_attemps = 0
@@ -387,7 +445,7 @@ class GdbRemoteTestCaseBase(TestBase):
             while connect_attemps < MAX_CONNECT_ATTEMPTS:
                 # Create a socket to talk to the server
                 try:
-                    logger.info("Connect attempt %d", connect_attemps+1)
+                    logger.info("Connect attempt %d", connect_attemps + 1)
                     self.sock = self.create_socket()
                     return server
                 except _ConnectionRefused as serr:
@@ -400,18 +458,27 @@ class GdbRemoteTestCaseBase(TestBase):
             server.terminate()
 
             # Increment attempts.
-            print("connect to debug monitor on port %d failed, attempt #%d of %d" % (self.port, attempts + 1, MAX_ATTEMPTS))
+            print(
+                "connect to debug monitor on port %d failed, attempt #%d of %d" %
+                (self.port, attempts + 1, MAX_ATTEMPTS))
             attempts += 1
 
-            # And wait a random length of time before next attempt, to avoid collisions.
-            time.sleep(random.randint(1,5))
-            
+            # And wait a random length of time before next attempt, to avoid
+            # collisions.
+            time.sleep(random.randint(1, 5))
+
             # Now grab a new port number.
             self.port = self.get_next_port()
 
-        raise Exception("failed to create a socket to the launched debug monitor after %d tries" % attempts)
-
-    def launch_process_for_attach(self, inferior_args=None, sleep_seconds=3, exe_path=None):
+        raise Exception(
+            "failed to create a socket to the launched debug monitor after %d tries" %
+            attempts)
+
+    def launch_process_for_attach(
+            self,
+            inferior_args=None,
+            sleep_seconds=3,
+            exe_path=None):
         # We're going to start a child process that the debug monitor stub can later attach to.
         # This process needs to be started so that it just hangs around for a while.  We'll
         # have it sleep.
@@ -425,15 +492,22 @@ class GdbRemoteTestCaseBase(TestBase):
             args.append("sleep:%d" % sleep_seconds)
 
         inferior = self.spawnSubprocess(exe_path, args)
+
         def shutdown_process_for_attach():
             try:
                 inferior.terminate()
             except:
-                logger.warning("failed to terminate inferior process for attach: {}; ignoring".format(sys.exc_info()[0]))
+                logger.warning(
+                    "failed to terminate inferior process for attach: {}; ignoring".format(
+                        sys.exc_info()[0]))
         self.addTearDownHook(shutdown_process_for_attach)
         return inferior
 
-    def prep_debug_monitor_and_inferior(self, inferior_args=None, inferior_sleep_seconds=3, inferior_exe_path=None):
+    def prep_debug_monitor_and_inferior(
+            self,
+            inferior_args=None,
+            inferior_sleep_seconds=3,
+            inferior_exe_path=None):
         """Prep the debug monitor, the inferior, and the expected packet stream.
 
         Handle the separate cases of using the debug monitor in attach-to-inferior mode
@@ -458,11 +532,15 @@ class GdbRemoteTestCaseBase(TestBase):
 
         if self._inferior_startup == self._STARTUP_ATTACH or self._inferior_startup == self._STARTUP_ATTACH_MANUALLY:
             # Launch the process that we'll use as the inferior.
-            inferior = self.launch_process_for_attach(inferior_args=inferior_args, sleep_seconds=inferior_sleep_seconds, exe_path=inferior_exe_path)
+            inferior = self.launch_process_for_attach(
+                inferior_args=inferior_args,
+                sleep_seconds=inferior_sleep_seconds,
+                exe_path=inferior_exe_path)
             self.assertIsNotNone(inferior)
             self.assertTrue(inferior.pid > 0)
             if self._inferior_startup == self._STARTUP_ATTACH:
-                # In this case, we want the stub to attach via the command line, so set the command line attach pid here.
+                # In this case, we want the stub to attach via the command
+                # line, so set the command line attach pid here.
                 attach_pid = inferior.pid
 
         if self._inferior_startup == self._STARTUP_LAUNCH:
@@ -471,11 +549,15 @@ class GdbRemoteTestCaseBase(TestBase):
                 inferior_exe_path = os.path.abspath("a.out")
 
             if lldb.remote_platform:
-                remote_path = lldbutil.append_to_process_working_directory(os.path.basename(inferior_exe_path))
+                remote_path = lldbutil.append_to_process_working_directory(
+                    os.path.basename(inferior_exe_path))
                 remote_file_spec = lldb.SBFileSpec(remote_path, False)
-                err = lldb.remote_platform.Install(lldb.SBFileSpec(inferior_exe_path, True), remote_file_spec)
+                err = lldb.remote_platform.Install(lldb.SBFileSpec(
+                    inferior_exe_path, True), remote_file_spec)
                 if err.Fail():
-                    raise Exception("remote_platform.Install('%s', '%s') failed: %s" % (inferior_exe_path, remote_path, err))
+                    raise Exception(
+                        "remote_platform.Install('%s', '%s') failed: %s" %
+                        (inferior_exe_path, remote_path, err))
                 inferior_exe_path = remote_path
 
             launch_args = [inferior_exe_path]
@@ -491,13 +573,18 @@ class GdbRemoteTestCaseBase(TestBase):
         if self._inferior_startup == self._STARTUP_LAUNCH:
             self.add_verified_launch_packets(launch_args)
 
-        return {"inferior":inferior, "server":server}
+        return {"inferior": inferior, "server": server}
 
-    def expect_socket_recv(self, sock, expected_content_regex, timeout_seconds):
+    def expect_socket_recv(
+            self,
+            sock,
+            expected_content_regex,
+            timeout_seconds):
         response = ""
         timeout_time = time.time() + timeout_seconds
 
-        while not expected_content_regex.match(response) and time.time() < timeout_time: 
+        while not expected_content_regex.match(
+                response) and time.time() < timeout_time:
             can_read, _, _ = select.select([sock], [], [], timeout_seconds)
             if can_read and sock in can_read:
                 recv_bytes = sock.recv(4096)
@@ -514,7 +601,8 @@ class GdbRemoteTestCaseBase(TestBase):
             _, can_write, _ = select.select([], [sock], [], timeout_seconds)
             if can_write and sock in can_write:
                 written_byte_count = sock.send(request_bytes_remaining)
-                request_bytes_remaining = request_bytes_remaining[written_byte_count:]
+                request_bytes_remaining = request_bytes_remaining[
+                    written_byte_count:]
         self.assertEqual(len(request_bytes_remaining), 0)
 
     def do_handshake(self, stub_socket, timeout_seconds=5):
@@ -527,7 +615,8 @@ class GdbRemoteTestCaseBase(TestBase):
         self.assertEqual(bytes_sent, len(NO_ACK_MODE_REQUEST))
 
         # Receive the ack and "OK"
-        self.expect_socket_recv(stub_socket, re.compile(r"^\+\$OK#[0-9a-fA-F]{2}$"), timeout_seconds)
+        self.expect_socket_recv(stub_socket, re.compile(
+            r"^\+\$OK#[0-9a-fA-F]{2}$"), timeout_seconds)
 
         # Send the final ack.
         self.expect_socket_send(stub_socket, "+", timeout_seconds)
@@ -553,12 +642,12 @@ class GdbRemoteTestCaseBase(TestBase):
         self.test_sequence.add_log_lines(
             ["read packet: $QThreadSuffixSupported#e4",
              "send packet: $OK#00",
-            ], True)
+             ], True)
 
     def add_process_info_collection_packets(self):
         self.test_sequence.add_log_lines(
             ["read packet: $qProcessInfo#dc",
-              { "direction":"send", "regex":r"^\$(.+)#[0-9a-fA-F]{2}$", "capture":{1:"process_info_raw"} }],
+             {"direction": "send", "regex": r"^\$(.+)#[0-9a-fA-F]{2}$", "capture": {1: "process_info_raw"}}],
             True)
 
     _KNOWN_PROCESS_INFO_KEYS = [
@@ -575,7 +664,7 @@ class GdbRemoteTestCaseBase(TestBase):
         "vendor",
         "endian",
         "ptrsize"
-        ]
+    ]
 
     def parse_process_info_response(self, context):
         # Ensure we have a process info response.
@@ -584,7 +673,9 @@ class GdbRemoteTestCaseBase(TestBase):
         self.assertIsNotNone(process_info_raw)
 
         # Pull out key:value; pairs.
-        process_info_dict = { match.group(1):match.group(2) for match in re.finditer(r"([^:]+):([^;]+);", process_info_raw) }
+        process_info_dict = {
+            match.group(1): match.group(2) for match in re.finditer(
+                r"([^:]+):([^;]+);", process_info_raw)}
 
         # Validate keys are known.
         for (key, val) in list(process_info_dict.items()):
@@ -595,9 +686,9 @@ class GdbRemoteTestCaseBase(TestBase):
 
     def add_register_info_collection_packets(self):
         self.test_sequence.add_log_lines(
-            [ { "type":"multi_response", "query":"qRegisterInfo", "append_iteration_suffix":True,
-              "end_regex":re.compile(r"^\$(E\d+)?#[0-9a-fA-F]{2}$"),
-              "save_key":"reg_info_responses" } ],
+            [{"type": "multi_response", "query": "qRegisterInfo", "append_iteration_suffix": True,
+                "end_regex": re.compile(r"^\$(E\d+)?#[0-9a-fA-F]{2}$"),
+                "save_key": "reg_info_responses"}],
             True)
 
     def parse_register_info_packets(self, context):
@@ -606,13 +697,19 @@ class GdbRemoteTestCaseBase(TestBase):
         self.assertIsNotNone(reg_info_responses)
 
         # Parse register infos.
-        return [parse_reg_info_response(reg_info_response) for reg_info_response in reg_info_responses]
+        return [parse_reg_info_response(reg_info_response)
+                for reg_info_response in reg_info_responses]
 
     def expect_gdbremote_sequence(self, timeout_seconds=None):
         if not timeout_seconds:
             timeout_seconds = self._TIMEOUT_SECONDS
-        return expect_lldb_gdbserver_replay(self, self.sock, self.test_sequence,
-                self._pump_queues, timeout_seconds, self.logger)
+        return expect_lldb_gdbserver_replay(
+            self,
+            self.sock,
+            self.test_sequence,
+            self._pump_queues,
+            timeout_seconds,
+            self.logger)
 
     _KNOWN_REGINFO_KEYS = [
         "name",
@@ -667,7 +764,7 @@ class GdbRemoteTestCaseBase(TestBase):
     def add_query_memory_region_packets(self, address):
         self.test_sequence.add_log_lines(
             ["read packet: $qMemoryRegionInfo:{0:x}#00".format(address),
-             {"direction":"send", "regex":r"^\$(.+)#[0-9a-fA-F]{2}$", "capture":{1:"memory_region_response"} }],
+             {"direction": "send", "regex": r"^\$(.+)#[0-9a-fA-F]{2}$", "capture": {1: "memory_region_response"}}],
             True)
 
     def parse_key_val_dict(self, key_val_text, allow_dupes=True):
@@ -678,13 +775,15 @@ class GdbRemoteTestCaseBase(TestBase):
             val = match.group(2)
             if key in kv_dict:
                 if allow_dupes:
-                    if type(kv_dict[key]) == list:
+                    if isinstance(kv_dict[key], list):
                         kv_dict[key].append(val)
                     else:
                         # Promote to list
                         kv_dict[key] = [kv_dict[key], val]
                 else:
-                    self.fail("key '{}' already present when attempting to add value '{}' (text='{}', dict={})".format(key, val, key_val_text, kv_dict))
+                    self.fail(
+                        "key '{}' already present when attempting to add value '{}' (text='{}', dict={})".format(
+                            key, val, key_val_text, kv_dict))
             else:
                 kv_dict[key] = val
         return kv_dict
@@ -694,17 +793,25 @@ class GdbRemoteTestCaseBase(TestBase):
         self.assertIsNotNone(context.get("memory_region_response"))
 
         # Pull out key:value; pairs.
-        mem_region_dict = self.parse_key_val_dict(context.get("memory_region_response"))
+        mem_region_dict = self.parse_key_val_dict(
+            context.get("memory_region_response"))
 
         # Validate keys are known.
         for (key, val) in list(mem_region_dict.items()):
-            self.assertTrue(key in ["start", "size", "permissions", "name", "error"])
+            self.assertTrue(
+                key in [
+                    "start",
+                    "size",
+                    "permissions",
+                    "name",
+                    "error"])
             self.assertIsNotNone(val)
 
         # Return the dictionary of key-value pairs for the memory region.
         return mem_region_dict
 
-    def assert_address_within_memory_region(self, test_address, mem_region_dict):
+    def assert_address_within_memory_region(
+            self, test_address, mem_region_dict):
         self.assertIsNotNone(mem_region_dict)
         self.assertTrue("start" in mem_region_dict)
         self.assertTrue("size" in mem_region_dict)
@@ -714,15 +821,25 @@ class GdbRemoteTestCaseBase(TestBase):
         range_end = range_start + range_size
 
         if test_address < range_start:
-            self.fail("address 0x{0:x} comes before range 0x{1:x} - 0x{2:x} (size 0x{3:x})".format(test_address, range_start, range_end, range_size))
+            self.fail(
+                "address 0x{0:x} comes before range 0x{1:x} - 0x{2:x} (size 0x{3:x})".format(
+                    test_address,
+                    range_start,
+                    range_end,
+                    range_size))
         elif test_address >= range_end:
-            self.fail("address 0x{0:x} comes after range 0x{1:x} - 0x{2:x} (size 0x{3:x})".format(test_address, range_start, range_end, range_size))
+            self.fail(
+                "address 0x{0:x} comes after range 0x{1:x} - 0x{2:x} (size 0x{3:x})".format(
+                    test_address,
+                    range_start,
+                    range_end,
+                    range_size))
 
     def add_threadinfo_collection_packets(self):
         self.test_sequence.add_log_lines(
-            [ { "type":"multi_response", "first_query":"qfThreadInfo", "next_query":"qsThreadInfo",
-                "append_iteration_suffix":False, "end_regex":re.compile(r"^\$(l)?#[0-9a-fA-F]{2}$"),
-              "save_key":"threadinfo_responses" } ],
+            [{"type": "multi_response", "first_query": "qfThreadInfo", "next_query": "qsThreadInfo",
+                "append_iteration_suffix": False, "end_regex": re.compile(r"^\$(l)?#[0-9a-fA-F]{2}$"),
+                "save_key": "threadinfo_responses"}],
             True)
 
     def parse_threadinfo_packets(self, context):
@@ -760,35 +877,44 @@ class GdbRemoteTestCaseBase(TestBase):
 
         return threads
 
-    def add_set_breakpoint_packets(self, address, do_continue=True, breakpoint_kind=1):
+    def add_set_breakpoint_packets(
+            self,
+            address,
+            do_continue=True,
+            breakpoint_kind=1):
         self.test_sequence.add_log_lines(
-            [# Set the breakpoint.
-             "read packet: $Z0,{0:x},{1}#00".format(address, breakpoint_kind),
-             # Verify the stub could set it.
-             "send packet: $OK#00",
-             ], True)
+            [  # Set the breakpoint.
+                "read packet: $Z0,{0:x},{1}#00".format(
+                    address, breakpoint_kind),
+                # Verify the stub could set it.
+                "send packet: $OK#00",
+            ], True)
 
         if (do_continue):
             self.test_sequence.add_log_lines(
-                [# Continue the inferior.
-                 "read packet: $c#63",
-                 # Expect a breakpoint stop report.
-                 {"direction":"send", "regex":r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);", "capture":{1:"stop_signo", 2:"stop_thread_id"} },
-                 ], True)        
+                [  # Continue the inferior.
+                    "read packet: $c#63",
+                    # Expect a breakpoint stop report.
+                    {"direction": "send",
+                     "regex": r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);",
+                     "capture": {1: "stop_signo",
+                                 2: "stop_thread_id"}},
+                ], True)
 
     def add_remove_breakpoint_packets(self, address, breakpoint_kind=1):
         self.test_sequence.add_log_lines(
-            [# Remove the breakpoint.
-             "read packet: $z0,{0:x},{1}#00".format(address, breakpoint_kind),
-             # Verify the stub could unset it.
-             "send packet: $OK#00",
+            [  # Remove the breakpoint.
+                "read packet: $z0,{0:x},{1}#00".format(
+                    address, breakpoint_kind),
+                # Verify the stub could unset it.
+                "send packet: $OK#00",
             ], True)
 
     def add_qSupported_packets(self):
         self.test_sequence.add_log_lines(
             ["read packet: $qSupported#00",
-             {"direction":"send", "regex":r"^\$(.*)#[0-9a-fA-F]{2}", "capture":{1: "qSupported_response"}},
-            ], True)
+             {"direction": "send", "regex": r"^\$(.*)#[0-9a-fA-F]{2}", "capture": {1: "qSupported_response"}},
+             ], True)
 
     _KNOWN_QSUPPORTED_STUB_FEATURES = [
         "augmented-libraries-svr4-read",
@@ -821,23 +947,27 @@ class GdbRemoteTestCaseBase(TestBase):
                 supported_dict[key] = val
             else:
                 if len(key) < 2:
-                    raise Exception("singular stub feature is too short: must be stub_feature{+,-,?}")
+                    raise Exception(
+                        "singular stub feature is too short: must be stub_feature{+,-,?}")
                 supported_type = key[-1]
                 key = key[:-1]
                 if not supported_type in ["+", "-", "?"]:
-                    raise Exception("malformed stub feature: final character {} not in expected set (+,-,?)".format(supported_type))
-                supported_dict[key] = supported_type 
+                    raise Exception(
+                        "malformed stub feature: final character {} not in expected set (+,-,?)".format(supported_type))
+                supported_dict[key] = supported_type
             # Ensure we know the supported element
-            if not key in self._KNOWN_QSUPPORTED_STUB_FEATURES:
-                raise Exception("unknown qSupported stub feature reported: %s" % key)
+            if key not in self._KNOWN_QSUPPORTED_STUB_FEATURES:
+                raise Exception(
+                    "unknown qSupported stub feature reported: %s" %
+                    key)
 
         return supported_dict
 
     def run_process_then_stop(self, run_seconds=1):
         # Tell the stub to continue.
         self.test_sequence.add_log_lines(
-             ["read packet: $vCont;c#a8"],
-             True)
+            ["read packet: $vCont;c#a8"],
+            True)
         context = self.expect_gdbremote_sequence()
 
         # Wait for run_seconds.
@@ -847,7 +977,7 @@ class GdbRemoteTestCaseBase(TestBase):
         self.reset_test_sequence()
         self.test_sequence.add_log_lines(
             ["read packet: {}".format(chr(3)),
-             {"direction":"send", "regex":r"^\$T([0-9a-fA-F]+)([^#]+)#[0-9a-fA-F]{2}$", "capture":{1:"stop_result"} }],
+             {"direction": "send", "regex": r"^\$T([0-9a-fA-F]+)([^#]+)#[0-9a-fA-F]{2}$", "capture": {1: "stop_result"}}],
             True)
         context = self.expect_gdbremote_sequence()
         self.assertIsNotNone(context)
@@ -857,18 +987,21 @@ class GdbRemoteTestCaseBase(TestBase):
 
     def select_modifiable_register(self, reg_infos):
         """Find a register that can be read/written freely."""
-        PREFERRED_REGISTER_NAMES = set(["rax",])
+        PREFERRED_REGISTER_NAMES = set(["rax", ])
 
-        # First check for the first register from the preferred register name set.
+        # First check for the first register from the preferred register name
+        # set.
         alternative_register_index = None
 
         self.assertIsNotNone(reg_infos)
         for reg_info in reg_infos:
-            if ("name" in reg_info) and (reg_info["name"] in PREFERRED_REGISTER_NAMES):
+            if ("name" in reg_info) and (
+                    reg_info["name"] in PREFERRED_REGISTER_NAMES):
                 # We found a preferred register.  Use it.
                 return reg_info["lldb_register_index"]
             if ("generic" in reg_info) and (reg_info["generic"] == "fp"):
-                # A frame pointer register will do as a register to modify temporarily.
+                # A frame pointer register will do as a register to modify
+                # temporarily.
                 alternative_register_index = reg_info["lldb_register_index"]
 
         # We didn't find a preferred register.  Return whatever alternative register
@@ -901,7 +1034,8 @@ class GdbRemoteTestCaseBase(TestBase):
     def find_generic_register_with_name(self, reg_infos, generic_name):
         self.assertIsNotNone(reg_infos)
         for reg_info in reg_infos:
-            if ("generic" in reg_info) and (reg_info["generic"] == generic_name):
+            if ("generic" in reg_info) and (
+                    reg_info["generic"] == generic_name):
                 return reg_info
         return None
 
@@ -912,13 +1046,13 @@ class GdbRemoteTestCaseBase(TestBase):
             if encoded_bytes[i] == "}":
                 # Handle escaped char.
                 self.assertTrue(i + 1 < len(encoded_bytes))
-                decoded_bytes += chr(ord(encoded_bytes[i+1]) ^ 0x20)
-                i +=2
+                decoded_bytes += chr(ord(encoded_bytes[i + 1]) ^ 0x20)
+                i += 2
             elif encoded_bytes[i] == "*":
                 # Handle run length encoding.
                 self.assertTrue(len(decoded_bytes) > 0)
                 self.assertTrue(i + 1 < len(encoded_bytes))
-                repeat_count = ord(encoded_bytes[i+1]) - 29
+                repeat_count = ord(encoded_bytes[i + 1]) - 29
                 decoded_bytes += decoded_bytes[-1] * repeat_count
                 i += 2
             else:
@@ -955,7 +1089,8 @@ class GdbRemoteTestCaseBase(TestBase):
             self.assertFalse(key in auxv_dict)
             auxv_dict[key] = value
 
-        self.fail("should not reach here - implies required double zero entry not found")
+        self.fail(
+            "should not reach here - implies required double zero entry not found")
         return auxv_dict
 
     def read_binary_data_in_chunks(self, command_prefix, chunk_length):
@@ -967,10 +1102,21 @@ class GdbRemoteTestCaseBase(TestBase):
         while not done:
             # Grab the next iteration of data.
             self.reset_test_sequence()
-            self.test_sequence.add_log_lines([
-                "read packet: ${}{:x},{:x}:#00".format(command_prefix, offset, chunk_length),
-                {"direction":"send", "regex":re.compile(r"^\$([^E])(.*)#[0-9a-fA-F]{2}$", re.MULTILINE|re.DOTALL), "capture":{1:"response_type", 2:"content_raw"} }
-                ], True)
+            self.test_sequence.add_log_lines(
+                [
+                    "read packet: ${}{:x},{:x}:#00".format(
+                        command_prefix,
+                        offset,
+                        chunk_length),
+                    {
+                        "direction": "send",
+                        "regex": re.compile(
+                            r"^\$([^E])(.*)#[0-9a-fA-F]{2}$",
+                            re.MULTILINE | re.DOTALL),
+                        "capture": {
+                            1: "response_type",
+                            2: "content_raw"}}],
+                True)
 
             context = self.expect_gdbremote_sequence()
             self.assertIsNotNone(context)
@@ -997,25 +1143,32 @@ class GdbRemoteTestCaseBase(TestBase):
             # Send the intterupt.
             "read packet: {}".format(chr(3)),
             # And wait for the stop notification.
-            {"direction":"send", "regex":r"^\$T([0-9a-fA-F]{2})(.*)#[0-9a-fA-F]{2}$", "capture":{1:"stop_signo", 2:"stop_key_val_text" } },
-            ], True)
+            {"direction": "send",
+             "regex": r"^\$T([0-9a-fA-F]{2})(.*)#[0-9a-fA-F]{2}$",
+             "capture": {1: "stop_signo",
+                         2: "stop_key_val_text"}},
+        ], True)
 
     def parse_interrupt_packets(self, context):
         self.assertIsNotNone(context.get("stop_signo"))
         self.assertIsNotNone(context.get("stop_key_val_text"))
-        return (int(context["stop_signo"], 16), self.parse_key_val_dict(context["stop_key_val_text"]))
+        return (int(context["stop_signo"], 16), self.parse_key_val_dict(
+            context["stop_key_val_text"]))
 
     def add_QSaveRegisterState_packets(self, thread_id):
         if thread_id:
             # Use the thread suffix form.
-            request = "read packet: $QSaveRegisterState;thread:{:x}#00".format(thread_id)
+            request = "read packet: $QSaveRegisterState;thread:{:x}#00".format(
+                thread_id)
         else:
             request = "read packet: $QSaveRegisterState#00"
-            
-        self.test_sequence.add_log_lines([
-            request,
-            {"direction":"send", "regex":r"^\$(E?.*)#[0-9a-fA-F]{2}$", "capture":{1:"save_response" } },
-            ], True)
+
+        self.test_sequence.add_log_lines([request,
+                                          {"direction": "send",
+                                           "regex": r"^\$(E?.*)#[0-9a-fA-F]{2}$",
+                                           "capture": {1: "save_response"}},
+                                          ],
+                                         True)
 
     def parse_QSaveRegisterState_response(self, context):
         self.assertIsNotNone(context)
@@ -1032,16 +1185,19 @@ class GdbRemoteTestCaseBase(TestBase):
     def add_QRestoreRegisterState_packets(self, save_id, thread_id=None):
         if thread_id:
             # Use the thread suffix form.
-            request = "read packet: $QRestoreRegisterState:{};thread:{:x}#00".format(save_id, thread_id)
+            request = "read packet: $QRestoreRegisterState:{};thread:{:x}#00".format(
+                save_id, thread_id)
         else:
-            request = "read packet: $QRestoreRegisterState:{}#00".format(save_id)
+            request = "read packet: $QRestoreRegisterState:{}#00".format(
+                save_id)
 
         self.test_sequence.add_log_lines([
             request,
             "send packet: $OK#00"
-            ], True)
+        ], True)
 
-    def flip_all_bits_in_each_register_value(self, reg_infos, endian, thread_id=None):
+    def flip_all_bits_in_each_register_value(
+            self, reg_infos, endian, thread_id=None):
         self.assertIsNotNone(reg_infos)
 
         successful_writes = 0
@@ -1049,16 +1205,18 @@ class GdbRemoteTestCaseBase(TestBase):
 
         for reg_info in reg_infos:
             # Use the lldb register index added to the reg info.  We're not necessarily
-            # working off a full set of register infos, so an inferred register index could be wrong. 
+            # working off a full set of register infos, so an inferred register
+            # index could be wrong.
             reg_index = reg_info["lldb_register_index"]
             self.assertIsNotNone(reg_index)
 
-            reg_byte_size = int(reg_info["bitsize"])/8
+            reg_byte_size = int(reg_info["bitsize"]) / 8
             self.assertTrue(reg_byte_size > 0)
 
             # Handle thread suffix.
             if thread_id:
-                p_request = "read packet: $p{:x};thread:{:x}#00".format(reg_index, thread_id)
+                p_request = "read packet: $p{:x};thread:{:x}#00".format(
+                    reg_index, thread_id)
             else:
                 p_request = "read packet: $p{:x}#00".format(reg_index)
 
@@ -1066,15 +1224,16 @@ class GdbRemoteTestCaseBase(TestBase):
             self.reset_test_sequence()
             self.test_sequence.add_log_lines([
                 p_request,
-                { "direction":"send", "regex":r"^\$([0-9a-fA-F]+)#", "capture":{1:"p_response"} },
-                ], True)
+                {"direction": "send", "regex": r"^\$([0-9a-fA-F]+)#", "capture": {1: "p_response"}},
+            ], True)
             context = self.expect_gdbremote_sequence()
             self.assertIsNotNone(context)
 
             # Verify the response length.
             p_response = context.get("p_response")
             self.assertIsNotNone(p_response)
-            initial_reg_value = unpack_register_hex_unsigned(endian, p_response)
+            initial_reg_value = unpack_register_hex_unsigned(
+                endian, p_response)
 
             # Flip the value by xoring with all 1s
             all_one_bits_raw = "ff" * (int(reg_info["bitsize"]) / 8)
@@ -1083,16 +1242,22 @@ class GdbRemoteTestCaseBase(TestBase):
 
             # Handle thread suffix for P.
             if thread_id:
-                P_request = "read packet: $P{:x}={};thread:{:x}#00".format(reg_index, pack_register_hex(endian, flipped_bits_int, byte_size=reg_byte_size), thread_id)
+                P_request = "read packet: $P{:x}={};thread:{:x}#00".format(
+                    reg_index, pack_register_hex(
+                        endian, flipped_bits_int, byte_size=reg_byte_size), thread_id)
             else:
-                P_request = "read packet: $P{:x}={}#00".format(reg_index, pack_register_hex(endian, flipped_bits_int, byte_size=reg_byte_size))
+                P_request = "read packet: $P{:x}={}#00".format(
+                    reg_index, pack_register_hex(
+                        endian, flipped_bits_int, byte_size=reg_byte_size))
 
             # Write the flipped value to the register.
             self.reset_test_sequence()
-            self.test_sequence.add_log_lines([
-                P_request,
-                { "direction":"send", "regex":r"^\$(OK|E[0-9a-fA-F]+)#[0-9a-fA-F]{2}", "capture":{1:"P_response"} },
-                ], True)
+            self.test_sequence.add_log_lines([P_request,
+                                              {"direction": "send",
+                                               "regex": r"^\$(OK|E[0-9a-fA-F]+)#[0-9a-fA-F]{2}",
+                                               "capture": {1: "P_response"}},
+                                              ],
+                                             True)
             context = self.expect_gdbremote_sequence()
             self.assertIsNotNone(context)
 
@@ -1107,25 +1272,27 @@ class GdbRemoteTestCaseBase(TestBase):
                 failed_writes += 1
                 # print("reg (index={}, name={}) write FAILED (error: {})".format(reg_index, reg_info["name"], P_response))
 
-            # Read back the register value, ensure it matches the flipped value.
+            # Read back the register value, ensure it matches the flipped
+            # value.
             if P_response == "OK":
                 self.reset_test_sequence()
                 self.test_sequence.add_log_lines([
                     p_request,
-                    { "direction":"send", "regex":r"^\$([0-9a-fA-F]+)#", "capture":{1:"p_response"} },
-                    ], True)
+                    {"direction": "send", "regex": r"^\$([0-9a-fA-F]+)#", "capture": {1: "p_response"}},
+                ], True)
                 context = self.expect_gdbremote_sequence()
                 self.assertIsNotNone(context)
 
                 verify_p_response_raw = context.get("p_response")
                 self.assertIsNotNone(verify_p_response_raw)
-                verify_bits = unpack_register_hex_unsigned(endian, verify_p_response_raw)
+                verify_bits = unpack_register_hex_unsigned(
+                    endian, verify_p_response_raw)
 
                 if verify_bits != flipped_bits_int:
                     # Some registers, like mxcsrmask and others, will permute what's written.  Adjust succeed/fail counts.
                     # print("reg (index={}, name={}): read verify FAILED: wrote {:x}, verify read back {:x}".format(reg_index, reg_info["name"], flipped_bits_int, verify_bits))
                     successful_writes -= 1
-                    failed_writes +=1
+                    failed_writes += 1
 
         return (successful_writes, failed_writes)
 
@@ -1136,7 +1303,8 @@ class GdbRemoteTestCaseBase(TestBase):
             return False
         if reg_info["set"] != "General Purpose Registers":
             return False
-        if ("container-regs" in reg_info) and (len(reg_info["container-regs"]) > 0):
+        if ("container-regs" in reg_info) and (
+                len(reg_info["container-regs"]) > 0):
             # Don't try to bit flip registers contained in another register.
             return False
         if re.match("^.s$", reg_info["name"]):
@@ -1154,13 +1322,15 @@ class GdbRemoteTestCaseBase(TestBase):
         values = {}
 
         for reg_info in reg_infos:
-            # We append a register index when load reg infos so we can work with subsets.
+            # We append a register index when load reg infos so we can work
+            # with subsets.
             reg_index = reg_info.get("lldb_register_index")
             self.assertIsNotNone(reg_index)
 
             # Handle thread suffix.
             if thread_id:
-                p_request = "read packet: $p{:x};thread:{:x}#00".format(reg_index, thread_id)
+                p_request = "read packet: $p{:x};thread:{:x}#00".format(
+                    reg_index, thread_id)
             else:
                 p_request = "read packet: $p{:x}#00".format(reg_index)
 
@@ -1168,8 +1338,8 @@ class GdbRemoteTestCaseBase(TestBase):
             self.reset_test_sequence()
             self.test_sequence.add_log_lines([
                 p_request,
-                { "direction":"send", "regex":r"^\$([0-9a-fA-F]+)#", "capture":{1:"p_response"} },
-                ], True)
+                {"direction": "send", "regex": r"^\$([0-9a-fA-F]+)#", "capture": {1: "p_response"}},
+            ], True)
             context = self.expect_gdbremote_sequence()
             self.assertIsNotNone(context)
 
@@ -1178,58 +1348,75 @@ class GdbRemoteTestCaseBase(TestBase):
             self.assertIsNotNone(p_response)
             self.assertTrue(len(p_response) > 0)
             self.assertFalse(p_response[0] == "E")
-            
-            values[reg_index] = unpack_register_hex_unsigned(endian, p_response)
-            
+
+            values[reg_index] = unpack_register_hex_unsigned(
+                endian, p_response)
+
         return values
 
     def add_vCont_query_packets(self):
-        self.test_sequence.add_log_lines([
-            "read packet: $vCont?#49",
-            {"direction":"send", "regex":r"^\$(vCont)?(.*)#[0-9a-fA-F]{2}$", "capture":{2:"vCont_query_response" } },
-            ], True)
+        self.test_sequence.add_log_lines(["read packet: $vCont?#49",
+                                          {"direction": "send",
+                                           "regex": r"^\$(vCont)?(.*)#[0-9a-fA-F]{2}$",
+                                           "capture": {2: "vCont_query_response"}},
+                                          ],
+                                         True)
 
     def parse_vCont_query_response(self, context):
         self.assertIsNotNone(context)
         vCont_query_response = context.get("vCont_query_response")
 
-        # Handle case of no vCont support at all - in which case the capture group will be none or zero length.
+        # Handle case of no vCont support at all - in which case the capture
+        # group will be none or zero length.
         if not vCont_query_response or len(vCont_query_response) == 0:
             return {}
 
-        return {key:1 for key in vCont_query_response.split(";") if key and len(key) > 0}
+        return {key: 1 for key in vCont_query_response.split(
+            ";") if key and len(key) > 0}
 
-    def count_single_steps_until_true(self, thread_id, predicate, args, max_step_count=100, use_Hc_packet=True, step_instruction="s"):
+    def count_single_steps_until_true(
+            self,
+            thread_id,
+            predicate,
+            args,
+            max_step_count=100,
+            use_Hc_packet=True,
+            step_instruction="s"):
         """Used by single step test that appears in a few different contexts."""
         single_step_count = 0
 
         while single_step_count < max_step_count:
             self.assertIsNotNone(thread_id)
 
-            # Build the packet for the single step instruction.  We replace {thread}, if present, with the thread_id.
-            step_packet = "read packet: ${}#00".format(re.sub(r"{thread}", "{:x}".format(thread_id), step_instruction))
+            # Build the packet for the single step instruction.  We replace
+            # {thread}, if present, with the thread_id.
+            step_packet = "read packet: ${}#00".format(
+                re.sub(r"{thread}", "{:x}".format(thread_id), step_instruction))
             # print("\nstep_packet created: {}\n".format(step_packet))
 
             # Single step.
             self.reset_test_sequence()
             if use_Hc_packet:
                 self.test_sequence.add_log_lines(
-                    [# Set the continue thread.
-                     "read packet: $Hc{0:x}#00".format(thread_id),
-                     "send packet: $OK#00",
-                     ], True)
+                    [  # Set the continue thread.
+                        "read packet: $Hc{0:x}#00".format(thread_id),
+                        "send packet: $OK#00",
+                    ], True)
             self.test_sequence.add_log_lines([
-                 # Single step.
-                 step_packet,
-                 # "read packet: $vCont;s:{0:x}#00".format(thread_id),
-                 # Expect a breakpoint stop report.
-                 {"direction":"send", "regex":r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);", "capture":{1:"stop_signo", 2:"stop_thread_id"} },
-                 ], True)
+                # Single step.
+                step_packet,
+                # "read packet: $vCont;s:{0:x}#00".format(thread_id),
+                # Expect a breakpoint stop report.
+                {"direction": "send",
+                 "regex": r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);",
+                 "capture": {1: "stop_signo",
+                             2: "stop_thread_id"}},
+            ], True)
             context = self.expect_gdbremote_sequence()
             self.assertIsNotNone(context)
             self.assertIsNotNone(context.get("stop_signo"))
             self.assertEqual(int(context.get("stop_signo"), 16),
-                    lldbutil.get_signal_number('SIGTRAP'))
+                             lldbutil.get_signal_number('SIGTRAP'))
 
             single_step_count += 1
 
@@ -1251,9 +1438,9 @@ class GdbRemoteTestCaseBase(TestBase):
         self.reset_test_sequence()
         self.test_sequence.add_log_lines(
             ["read packet: $m{0:x},{1:x}#00".format(g_c1_address, 1),
-             {"direction":"send", "regex":r"^\$(.+)#[0-9a-fA-F]{2}$", "capture":{1:"g_c1_contents"} },
+             {"direction": "send", "regex": r"^\$(.+)#[0-9a-fA-F]{2}$", "capture": {1: "g_c1_contents"}},
              "read packet: $m{0:x},{1:x}#00".format(g_c2_address, 1),
-             {"direction":"send", "regex":r"^\$(.+)#[0-9a-fA-F]{2}$", "capture":{1:"g_c2_contents"} }],
+             {"direction": "send", "regex": r"^\$(.+)#[0-9a-fA-F]{2}$", "capture": {1: "g_c2_contents"}}],
             True)
 
         # Run the packet stream.
@@ -1264,26 +1451,34 @@ class GdbRemoteTestCaseBase(TestBase):
         self.assertIsNotNone(context.get("g_c1_contents"))
         self.assertIsNotNone(context.get("g_c2_contents"))
 
-        return (context.get("g_c1_contents").decode("hex") == expected_g_c1) and (context.get("g_c2_contents").decode("hex") == expected_g_c2)
+        return (context.get("g_c1_contents").decode("hex") == expected_g_c1) and (
+            context.get("g_c2_contents").decode("hex") == expected_g_c2)
 
-    def single_step_only_steps_one_instruction(self, use_Hc_packet=True, step_instruction="s"):
+    def single_step_only_steps_one_instruction(
+            self, use_Hc_packet=True, step_instruction="s"):
         """Used by single step test that appears in a few different contexts."""
         # Start up the inferior.
         procs = self.prep_debug_monitor_and_inferior(
-            inferior_args=["get-code-address-hex:swap_chars", "get-data-address-hex:g_c1", "get-data-address-hex:g_c2", "sleep:1", "call-function:swap_chars", "sleep:5"])
+            inferior_args=[
+                "get-code-address-hex:swap_chars",
+                "get-data-address-hex:g_c1",
+                "get-data-address-hex:g_c2",
+                "sleep:1",
+                "call-function:swap_chars",
+                "sleep:5"])
 
         # Run the process
         self.test_sequence.add_log_lines(
-            [# Start running after initial stop.
-             "read packet: $c#63",
-             # Match output line that prints the memory address of the function call entry point.
-             # Note we require launch-only testing so we can get inferior otuput.
-             { "type":"output_match", "regex":r"^code address: 0x([0-9a-fA-F]+)\r\ndata address: 0x([0-9a-fA-F]+)\r\ndata address: 0x([0-9a-fA-F]+)\r\n$", 
-               "capture":{ 1:"function_address", 2:"g_c1_address", 3:"g_c2_address"} },
-             # Now stop the inferior.
-             "read packet: {}".format(chr(3)),
-             # And wait for the stop notification.
-             {"direction":"send", "regex":r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);", "capture":{1:"stop_signo", 2:"stop_thread_id"} }],
+            [  # Start running after initial stop.
+                "read packet: $c#63",
+                # Match output line that prints the memory address of the function call entry point.
+                # Note we require launch-only testing so we can get inferior otuput.
+                {"type": "output_match", "regex": r"^code address: 0x([0-9a-fA-F]+)\r\ndata address: 0x([0-9a-fA-F]+)\r\ndata address: 0x([0-9a-fA-F]+)\r\n$",
+                 "capture": {1: "function_address", 2: "g_c1_address", 3: "g_c2_address"}},
+                # Now stop the inferior.
+                "read packet: {}".format(chr(3)),
+                # And wait for the stop notification.
+                {"direction": "send", "regex": r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+);", "capture": {1: "stop_signo", 2: "stop_thread_id"}}],
             True)
 
         # Run the packet stream.
@@ -1312,13 +1507,17 @@ class GdbRemoteTestCaseBase(TestBase):
         else:
             BREAKPOINT_KIND = 1
         self.reset_test_sequence()
-        self.add_set_breakpoint_packets(function_address, do_continue=True, breakpoint_kind=BREAKPOINT_KIND)
+        self.add_set_breakpoint_packets(
+            function_address,
+            do_continue=True,
+            breakpoint_kind=BREAKPOINT_KIND)
         context = self.expect_gdbremote_sequence()
         self.assertIsNotNone(context)
 
         # Remove the breakpoint.
         self.reset_test_sequence()
-        self.add_remove_breakpoint_packets(function_address, breakpoint_kind=BREAKPOINT_KIND)
+        self.add_remove_breakpoint_packets(
+            function_address, breakpoint_kind=BREAKPOINT_KIND)
         context = self.expect_gdbremote_sequence()
         self.assertIsNotNone(context)
 
@@ -1331,44 +1530,72 @@ class GdbRemoteTestCaseBase(TestBase):
 
         self.assertTrue(self.g_c1_c2_contents_are(args))
 
-        # Verify we take only a small number of steps to hit the first state.  Might need to work through function entry prologue code.
+        # Verify we take only a small number of steps to hit the first state.
+        # Might need to work through function entry prologue code.
         args["expected_g_c1"] = "1"
         args["expected_g_c2"] = "1"
-        (state_reached, step_count) = self.count_single_steps_until_true(main_thread_id, self.g_c1_c2_contents_are, args, max_step_count=25, use_Hc_packet=use_Hc_packet, step_instruction=step_instruction)
+        (state_reached,
+         step_count) = self.count_single_steps_until_true(main_thread_id,
+                                                          self.g_c1_c2_contents_are,
+                                                          args,
+                                                          max_step_count=25,
+                                                          use_Hc_packet=use_Hc_packet,
+                                                          step_instruction=step_instruction)
         self.assertTrue(state_reached)
 
         # Verify we hit the next state.
         args["expected_g_c1"] = "1"
         args["expected_g_c2"] = "0"
-        (state_reached, step_count) = self.count_single_steps_until_true(main_thread_id, self.g_c1_c2_contents_are, args, max_step_count=5, use_Hc_packet=use_Hc_packet, step_instruction=step_instruction)
+        (state_reached,
+         step_count) = self.count_single_steps_until_true(main_thread_id,
+                                                          self.g_c1_c2_contents_are,
+                                                          args,
+                                                          max_step_count=5,
+                                                          use_Hc_packet=use_Hc_packet,
+                                                          step_instruction=step_instruction)
         self.assertTrue(state_reached)
         expected_step_count = 1
         arch = self.getArchitecture()
 
-        #MIPS required "3" (ADDIU, SB, LD) machine instructions for updation of variable value
-        if re.match("mips",arch):
-           expected_step_count = 3
-        #S390X requires "2" (LARL, MVI) machine instructions for updation of variable value
-        if re.match("s390x",arch):
-           expected_step_count = 2
+        # MIPS required "3" (ADDIU, SB, LD) machine instructions for updation
+        # of variable value
+        if re.match("mips", arch):
+            expected_step_count = 3
+        # S390X requires "2" (LARL, MVI) machine instructions for updation of
+        # variable value
+        if re.match("s390x", arch):
+            expected_step_count = 2
         self.assertEqual(step_count, expected_step_count)
 
         # Verify we hit the next state.
         args["expected_g_c1"] = "0"
         args["expected_g_c2"] = "0"
-        (state_reached, step_count) = self.count_single_steps_until_true(main_thread_id, self.g_c1_c2_contents_are, args, max_step_count=5, use_Hc_packet=use_Hc_packet, step_instruction=step_instruction)
+        (state_reached,
+         step_count) = self.count_single_steps_until_true(main_thread_id,
+                                                          self.g_c1_c2_contents_are,
+                                                          args,
+                                                          max_step_count=5,
+                                                          use_Hc_packet=use_Hc_packet,
+                                                          step_instruction=step_instruction)
         self.assertTrue(state_reached)
         self.assertEqual(step_count, expected_step_count)
 
         # Verify we hit the next state.
         args["expected_g_c1"] = "0"
         args["expected_g_c2"] = "1"
-        (state_reached, step_count) = self.count_single_steps_until_true(main_thread_id, self.g_c1_c2_contents_are, args, max_step_count=5, use_Hc_packet=use_Hc_packet, step_instruction=step_instruction)
+        (state_reached,
+         step_count) = self.count_single_steps_until_true(main_thread_id,
+                                                          self.g_c1_c2_contents_are,
+                                                          args,
+                                                          max_step_count=5,
+                                                          use_Hc_packet=use_Hc_packet,
+                                                          step_instruction=step_instruction)
         self.assertTrue(state_reached)
         self.assertEqual(step_count, expected_step_count)
 
     def maybe_strict_output_regex(self, regex):
-        return '.*'+regex+'.*' if lldbplatformutil.hasChattyStderr(self) else '^'+regex+'$'
+        return '.*' + regex + \
+            '.*' if lldbplatformutil.hasChattyStderr(self) else '^' + regex + '$'
 
     def install_and_create_launch_args(self):
         exe_path = os.path.abspath('a.out')

Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py Tue Sep  6 15:57:50 2016
@@ -1,13 +1,13 @@
 from __future__ import print_function
 
 
-
 import gdbremote_testcase
 import signal
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
+
 class TestGdbRemoteAbort(gdbremote_testcase.GdbRemoteTestCaseBase):
     mydir = TestBase.compute_mydir(__file__)
 
@@ -15,10 +15,12 @@ class TestGdbRemoteAbort(gdbremote_testc
         procs = self.prep_debug_monitor_and_inferior(inferior_args=["abort"])
         self.assertIsNotNone(procs)
 
-        self.test_sequence.add_log_lines([
-            "read packet: $vCont;c#a8",
-            {"direction":"send", "regex":r"^\$T([0-9a-fA-F]{2}).*#[0-9a-fA-F]{2}$", "capture":{ 1:"hex_exit_code"} },
-            ], True)
+        self.test_sequence.add_log_lines(["read packet: $vCont;c#a8",
+                                          {"direction": "send",
+                                           "regex": r"^\$T([0-9a-fA-F]{2}).*#[0-9a-fA-F]{2}$",
+                                           "capture": {1: "hex_exit_code"}},
+                                          ],
+                                         True)
 
         context = self.expect_gdbremote_sequence()
         self.assertIsNotNone(context)
@@ -26,7 +28,7 @@ class TestGdbRemoteAbort(gdbremote_testc
         hex_exit_code = context.get("hex_exit_code")
         self.assertIsNotNone(hex_exit_code)
         self.assertEqual(int(hex_exit_code, 16),
-                          lldbutil.get_signal_number('SIGABRT'))
+                         lldbutil.get_signal_number('SIGABRT'))
 
     @debugserver_test
     def test_inferior_abort_received_debugserver(self):
@@ -41,4 +43,3 @@ class TestGdbRemoteAbort(gdbremote_testc
         self.init_llgs_test()
         self.build()
         self.inferior_abort_received()
-

Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/inferior-crash/TestGdbRemoteSegFault.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/inferior-crash/TestGdbRemoteSegFault.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/inferior-crash/TestGdbRemoteSegFault.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/inferior-crash/TestGdbRemoteSegFault.py Tue Sep  6 15:57:50 2016
@@ -1,26 +1,29 @@
 from __future__ import print_function
 
 
-
 import gdbremote_testcase
 import signal
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
+
 class TestGdbRemoteSegFault(gdbremote_testcase.GdbRemoteTestCaseBase):
     mydir = TestBase.compute_mydir(__file__)
 
     GDB_REMOTE_STOP_CODE_BAD_ACCESS = 0x91
 
     def inferior_seg_fault_received(self, expected_signo):
-        procs = self.prep_debug_monitor_and_inferior(inferior_args=["segfault"])
+        procs = self.prep_debug_monitor_and_inferior(
+            inferior_args=["segfault"])
         self.assertIsNotNone(procs)
 
-        self.test_sequence.add_log_lines([
-            "read packet: $vCont;c#a8",
-            {"direction":"send", "regex":r"^\$T([0-9a-fA-F]{2}).*#[0-9a-fA-F]{2}$", "capture":{ 1:"hex_exit_code"} },
-            ], True)
+        self.test_sequence.add_log_lines(["read packet: $vCont;c#a8",
+                                          {"direction": "send",
+                                           "regex": r"^\$T([0-9a-fA-F]{2}).*#[0-9a-fA-F]{2}$",
+                                           "capture": {1: "hex_exit_code"}},
+                                          ],
+                                         True)
 
         context = self.expect_gdbremote_sequence()
         self.assertIsNotNone(context)

Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py Tue Sep  6 15:57:50 2016
@@ -4,7 +4,6 @@
 from __future__ import print_function
 
 
-
 import os
 import os.path
 import platform
@@ -17,6 +16,7 @@ from lldbsuite.test.lldbtest import *
 
 from six.moves import queue
 
+
 def _get_debug_monitor_from_lldb(lldb_exe, debug_monitor_basename):
     """Return the debug monitor exe path given the lldb exe path.
 
@@ -55,7 +55,10 @@ def _get_debug_monitor_from_lldb(lldb_ex
     if os.path.exists(debug_monitor_exe):
         return debug_monitor_exe
 
-    new_base = regex.sub( 'LLDB.framework/Versions/A/Resources/' + debug_monitor_basename, exe_base)
+    new_base = regex.sub(
+        'LLDB.framework/Versions/A/Resources/' +
+        debug_monitor_basename,
+        exe_base)
     debug_monitor_exe = os.path.join(exe_dir, new_base)
     if os.path.exists(debug_monitor_exe):
         return debug_monitor_exe
@@ -73,7 +76,9 @@ def get_lldb_server_exe():
     if "LLDB_DEBUGSERVER_PATH" in os.environ:
         return os.environ["LLDB_DEBUGSERVER_PATH"]
 
-    return _get_debug_monitor_from_lldb(lldbtest_config.lldbExec, "lldb-server")
+    return _get_debug_monitor_from_lldb(
+        lldbtest_config.lldbExec, "lldb-server")
+
 
 def get_debugserver_exe():
     """Return the debugserver exe path.
@@ -85,10 +90,11 @@ def get_debugserver_exe():
     if "LLDB_DEBUGSERVER_PATH" in os.environ:
         return os.environ["LLDB_DEBUGSERVER_PATH"]
 
-    return _get_debug_monitor_from_lldb(lldbtest_config.lldbExec, "debugserver")
+    return _get_debug_monitor_from_lldb(
+        lldbtest_config.lldbExec, "debugserver")
 
 _LOG_LINE_REGEX = re.compile(r'^(lldb-server|debugserver)\s+<\s*(\d+)>' +
-    '\s+(read|send)\s+packet:\s+(.+)$')
+                             '\s+(read|send)\s+packet:\s+(.+)$')
 
 
 def _is_packet_lldb_gdbserver_input(packet_type, llgs_input_is_read):
@@ -131,10 +137,12 @@ def handle_O_packet(context, packet_cont
     new_text = gdbremote_hex_decode_string(packet_contents[1:])
     context["O_content"] += new_text
     context["O_count"] += 1
-    
+
     if logger:
-        logger.debug("text: new \"{}\", cumulative: \"{}\"".format(new_text, context["O_content"]))
-    
+        logger.debug(
+            "text: new \"{}\", cumulative: \"{}\"".format(
+                new_text, context["O_content"]))
+
     return True
 
 _STRIP_CHECKSUM_REGEX = re.compile(r'#[0-9a-fA-F]{2}$')
@@ -150,13 +158,14 @@ def assert_packets_equal(asserter, actua
     expected_stripped = _STRIP_CHECKSUM_REGEX.sub('', expected_packet)
     asserter.assertEqual(actual_stripped, expected_stripped)
 
+
 def expect_lldb_gdbserver_replay(
-    asserter,
-    sock,
-    test_sequence,
-    pump_queues,
-    timeout_seconds,
-    logger=None):
+        asserter,
+        sock,
+        test_sequence,
+        pump_queues,
+        timeout_seconds,
+        logger=None):
     """Replay socket communication with lldb-gdbserver and verify responses.
 
     Args:
@@ -188,16 +197,16 @@ def expect_lldb_gdbserver_replay(
         context["O_count"] will contain an integer of the number of
         O packets received.
     """
-    
+
     # Ensure we have some work to do.
     if len(test_sequence.entries) < 1:
         return {}
 
-    context = {"O_count":0, "O_content":""}
+    context = {"O_count": 0, "O_content": ""}
     with socket_packet_pump.SocketPacketPump(sock, pump_queues, logger) as pump:
         # Grab the first sequence entry.
         sequence_entry = test_sequence.entries.pop(0)
-        
+
         # While we have an active sequence entry, send messages
         # destined for the stub and collect/match/process responses
         # expected from the stub.
@@ -210,10 +219,12 @@ def expect_lldb_gdbserver_replay(
                         packet_desc = "^C"
                     else:
                         packet_desc = send_packet
-                    logger.info("sending packet to remote: {}".format(packet_desc))
+                    logger.info(
+                        "sending packet to remote: {}".format(packet_desc))
                 sock.sendall(send_packet)
             else:
-                # This is an entry expecting to receive content from the remote debug monitor.
+                # This is an entry expecting to receive content from the remote
+                # debug monitor.
 
                 # We'll pull from (and wait on) the queue appropriate for the type of matcher.
                 # We keep separate queues for process output (coming from non-deterministic
@@ -224,51 +235,65 @@ def expect_lldb_gdbserver_replay(
                         content = pump_queues.output_queue().get(True, timeout_seconds)
                     except queue.Empty:
                         if logger:
-                            logger.warning("timeout waiting for stub output (accumulated output:{})".format(pump.get_accumulated_output()))
-                        raise Exception("timed out while waiting for output match (accumulated output: {})".format(pump.get_accumulated_output()))
+                            logger.warning(
+                                "timeout waiting for stub output (accumulated output:{})".format(
+                                    pump.get_accumulated_output()))
+                        raise Exception(
+                            "timed out while waiting for output match (accumulated output: {})".format(
+                                pump.get_accumulated_output()))
                 else:
                     try:
                         content = pump_queues.packet_queue().get(True, timeout_seconds)
                     except queue.Empty:
                         if logger:
-                            logger.warning("timeout waiting for packet match (receive buffer: {})".format(pump.get_receive_buffer()))
-                        raise Exception("timed out while waiting for packet match (receive buffer: {})".format(pump.get_receive_buffer()))
-                
+                            logger.warning(
+                                "timeout waiting for packet match (receive buffer: {})".format(
+                                    pump.get_receive_buffer()))
+                        raise Exception(
+                            "timed out while waiting for packet match (receive buffer: {})".format(
+                                pump.get_receive_buffer()))
+
                 # Give the sequence entry the opportunity to match the content.
                 # Output matchers might match or pass after more output accumulates.
                 # Other packet types generally must match.
                 asserter.assertIsNotNone(content)
-                context = sequence_entry.assert_match(asserter, content, context=context)
+                context = sequence_entry.assert_match(
+                    asserter, content, context=context)
 
             # Move on to next sequence entry as needed.  Some sequence entries support executing multiple
-            # times in different states (for looping over query/response packets).
+            # times in different states (for looping over query/response
+            # packets).
             if sequence_entry.is_consumed():
                 if len(test_sequence.entries) > 0:
                     sequence_entry = test_sequence.entries.pop(0)
                 else:
                     sequence_entry = None
-    
+
         # Fill in the O_content entries.
         context["O_count"] = 1
         context["O_content"] = pump.get_accumulated_output()
-        
+
     return context
 
+
 def gdbremote_hex_encode_string(str):
     output = ''
     for c in str:
         output += '{0:02x}'.format(ord(c))
     return output
 
+
 def gdbremote_hex_decode_string(str):
     return str.decode("hex")
 
+
 def gdbremote_packet_encode_string(str):
     checksum = 0
     for c in str:
         checksum += ord(c)
     return '$' + str + '#{0:02x}'.format(checksum % 256)
 
+
 def build_gdbremote_A_packet(args_list):
     """Given a list of args, create a properly-formed $A packet containing each arg.
     """
@@ -322,7 +347,9 @@ def parse_threadinfo_response(response_p
     response_packet = _STRIP_CHECKSUM_REGEX.sub("", response_packet)
 
     # Return list of thread ids
-    return [int(thread_id_hex,16) for thread_id_hex in response_packet.split(",") if len(thread_id_hex) > 0]
+    return [int(thread_id_hex, 16) for thread_id_hex in response_packet.split(
+        ",") if len(thread_id_hex) > 0]
+
 
 def unpack_endian_binary_string(endian, value_string):
     """Unpack a gdb-remote binary (post-unescaped, i.e. not escaped) response to an unsigned int given endianness of the inferior."""
@@ -349,6 +376,7 @@ def unpack_endian_binary_string(endian,
         # pdp is valid but need to add parse code once needed.
         raise Exception("unsupported endian:{}".format(endian))
 
+
 def unpack_register_hex_unsigned(endian, value_string):
     """Unpack a gdb-remote $p-style response to an unsigned int given endianness of inferior."""
     if not endian:
@@ -370,6 +398,7 @@ def unpack_register_hex_unsigned(endian,
         # pdp is valid but need to add parse code once needed.
         raise Exception("unsupported endian:{}".format(endian))
 
+
 def pack_register_hex(endian, value, byte_size=None):
     """Unpack a gdb-remote $p-style response to an unsigned int given endianness of inferior."""
     if not endian:
@@ -383,7 +412,7 @@ def pack_register_hex(endian, value, byt
             value = value >> 8
         if byte_size:
             # Add zero-fill to the right/end (MSB side) of the value.
-            retval += "00" * (byte_size - len(retval)/2)
+            retval += "00" * (byte_size - len(retval) / 2)
         return retval
 
     elif endian == 'big':
@@ -393,20 +422,29 @@ def pack_register_hex(endian, value, byt
             value = value >> 8
         if byte_size:
             # Add zero-fill to the left/front (MSB side) of the value.
-            retval = ("00" * (byte_size - len(retval)/2)) + retval
+            retval = ("00" * (byte_size - len(retval) / 2)) + retval
         return retval
 
     else:
         # pdp is valid but need to add parse code once needed.
         raise Exception("unsupported endian:{}".format(endian))
 
+
 class GdbRemoteEntryBase(object):
+
     def is_output_matcher(self):
         return False
 
+
 class GdbRemoteEntry(GdbRemoteEntryBase):
 
-    def __init__(self, is_send_to_remote=True, exact_payload=None, regex=None, capture=None, expect_captures=None):
+    def __init__(
+            self,
+            is_send_to_remote=True,
+            exact_payload=None,
+            regex=None,
+            capture=None,
+            expect_captures=None):
         """Create an entry representing one piece of the I/O to/from a gdb remote debug monitor.
 
         Args:
@@ -469,9 +507,11 @@ class GdbRemoteEntry(GdbRemoteEntryBase)
 
     def get_send_packet(self):
         if not self.is_send_to_remote():
-            raise Exception("get_send_packet() called on GdbRemoteEntry that is not a send-to-remote packet")
+            raise Exception(
+                "get_send_packet() called on GdbRemoteEntry that is not a send-to-remote packet")
         if not self.exact_payload:
-            raise Exception("get_send_packet() called on GdbRemoteEntry but it doesn't have an exact payload")
+            raise Exception(
+                "get_send_packet() called on GdbRemoteEntry but it doesn't have an exact payload")
         return self.exact_payload
 
     def _assert_exact_payload_match(self, asserter, actual_packet):
@@ -482,14 +522,17 @@ class GdbRemoteEntry(GdbRemoteEntryBase)
         # Ensure the actual packet matches from the start of the actual packet.
         match = self.regex.match(actual_packet)
         if not match:
-            asserter.fail("regex '{}' failed to match against content '{}'".format(self.regex.pattern, actual_packet))
+            asserter.fail(
+                "regex '{}' failed to match against content '{}'".format(
+                    self.regex.pattern, actual_packet))
 
         if self.capture:
             # Handle captures.
             for group_index, var_name in list(self.capture.items()):
                 capture_text = match.group(group_index)
                 # It is okay for capture text to be None - which it will be if it is a group that can match nothing.
-                # The user must be okay with it since the regex itself matched above.
+                # The user must be okay with it since the regex itself matched
+                # above.
                 context[var_name] = capture_text
 
         if self.expect_captures:
@@ -497,7 +540,8 @@ class GdbRemoteEntry(GdbRemoteEntryBase)
             for group_index, var_name in list(self.expect_captures.items()):
                 capture_text = match.group(group_index)
                 if not capture_text:
-                    raise Exception("No content to expect for group index {}".format(group_index))
+                    raise Exception(
+                        "No content to expect for group index {}".format(group_index))
                 asserter.assertEqual(capture_text, context[var_name])
 
         return context
@@ -506,7 +550,8 @@ class GdbRemoteEntry(GdbRemoteEntryBase)
         # This only makes sense for matching lines coming from the
         # remote debug monitor.
         if self.is_send_to_remote():
-            raise Exception("Attempted to match a packet being sent to the remote debug monitor, doesn't make sense.")
+            raise Exception(
+                "Attempted to match a packet being sent to the remote debug monitor, doesn't make sense.")
 
         # Create a new context if needed.
         if not context:
@@ -521,16 +566,18 @@ class GdbRemoteEntry(GdbRemoteEntryBase)
         elif self.regex:
             return self._assert_regex_match(asserter, actual_packet, context)
         else:
-            raise Exception("Don't know how to match a remote-sent packet when exact_payload isn't specified.")
+            raise Exception(
+                "Don't know how to match a remote-sent packet when exact_payload isn't specified.")
+
 
 class MultiResponseGdbRemoteEntry(GdbRemoteEntryBase):
     """Represents a query/response style packet.
-    
+
     Assumes the first item is sent to the gdb remote.
     An end sequence regex indicates the end of the query/response
     packet sequence.  All responses up through (but not including) the
     end response are stored in a context variable.
-    
+
     Settings accepted from params:
 
         next_query or query: required.  The typical query packet without the $ prefix or #xx suffix.
@@ -557,17 +604,20 @@ class MultiResponseGdbRemoteEntry(GdbRem
             assume there is something wrong with either the response collection or the ending
             detection regex and throw an exception.
     """
+
     def __init__(self, params):
         self._next_query = params.get("next_query", params.get("query"))
         if not self._next_query:
             raise "either next_query or query key must be specified for MultiResponseGdbRemoteEntry"
-            
+
         self._first_query = params.get("first_query", self._next_query)
-        self._append_iteration_suffix = params.get("append_iteration_suffix", False)
+        self._append_iteration_suffix = params.get(
+            "append_iteration_suffix", False)
         self._iteration = 0
         self._end_regex = params["end_regex"]
         self._save_key = params["save_key"]
-        self._runaway_response_count = params.get("runaway_response_count", 10000)
+        self._runaway_response_count = params.get(
+            "runaway_response_count", 10000)
         self._is_send_to_remote = True
         self._end_matched = False
 
@@ -576,9 +626,11 @@ class MultiResponseGdbRemoteEntry(GdbRem
 
     def get_send_packet(self):
         if not self.is_send_to_remote():
-            raise Exception("get_send_packet() called on MultiResponseGdbRemoteEntry that is not in the send state")
+            raise Exception(
+                "get_send_packet() called on MultiResponseGdbRemoteEntry that is not in the send state")
         if self._end_matched:
-            raise Exception("get_send_packet() called on MultiResponseGdbRemoteEntry but end of query/response sequence has already been seen.")
+            raise Exception(
+                "get_send_packet() called on MultiResponseGdbRemoteEntry but end of query/response sequence has already been seen.")
 
         # Choose the first or next query for the base payload.
         if self._iteration == 0 and self._first_query:
@@ -593,7 +645,8 @@ class MultiResponseGdbRemoteEntry(GdbRem
         # Keep track of the iteration.
         self._iteration += 1
 
-        # Now that we've given the query packet, flip the mode to receive/match.
+        # Now that we've given the query packet, flip the mode to
+        # receive/match.
         self._is_send_to_remote = False
 
         # Return the result, converted to packet form.
@@ -603,12 +656,15 @@ class MultiResponseGdbRemoteEntry(GdbRem
         return self._end_matched
 
     def assert_match(self, asserter, actual_packet, context=None):
-        # This only makes sense for matching lines coming from the remote debug monitor.
+        # This only makes sense for matching lines coming from the remote debug
+        # monitor.
         if self.is_send_to_remote():
-            raise Exception("assert_match() called on MultiResponseGdbRemoteEntry but state is set to send a query packet.")
+            raise Exception(
+                "assert_match() called on MultiResponseGdbRemoteEntry but state is set to send a query packet.")
 
         if self._end_matched:
-            raise Exception("assert_match() called on MultiResponseGdbRemoteEntry but end of query/response sequence has already been seen.")
+            raise Exception(
+                "assert_match() called on MultiResponseGdbRemoteEntry but end of query/response sequence has already been seen.")
 
         # Set up a context as needed.
         if not context:
@@ -627,21 +683,27 @@ class MultiResponseGdbRemoteEntry(GdbRem
 
         # Check for a runaway response cycle.
         if len(context[self._save_key]) >= self._runaway_response_count:
-            raise Exception("runaway query/response cycle detected: %d responses captured so far. Last response: %s" %
-                (len(context[self._save_key]), context[self._save_key][-1]))
+            raise Exception(
+                "runaway query/response cycle detected: %d responses captured so far. Last response: %s" %
+                (len(
+                    context[
+                        self._save_key]), context[
+                    self._save_key][
+                    -1]))
 
         # Flip the mode to send for generating the query.
         self._is_send_to_remote = True
         return context
 
+
 class MatchRemoteOutputEntry(GdbRemoteEntryBase):
     """Waits for output from the debug monitor to match a regex or time out.
-    
+
     This entry type tries to match each time new gdb remote output is accumulated
     using a provided regex.  If the output does not match the regex within the
     given timeframe, the command fails the playback session.  If the regex does
     match, any capture fields are recorded in the context.
-    
+
     Settings accepted from params:
 
         regex: required. Specifies a compiled regex object that must either succeed
@@ -653,7 +715,7 @@ class MatchRemoteOutputEntry(GdbRemoteEn
             must match starting somewhere within the output text accumulated thus far.
             Default: "match" (i.e. the regex must match the entirety of the accumulated output
             buffer, so unexpected text will generally fail the match).
-        
+
         capture: optional.  If specified, is a dictionary of regex match group indices (should start
             with 1) to variable names that will store the capture group indicated by the
             index. For example, {1:"thread_id"} will store capture group 1's content in the
@@ -661,6 +723,7 @@ class MatchRemoteOutputEntry(GdbRemoteEn
             the value. The value stored off can be used later in a expect_captures expression.
             This arg only makes sense when regex is specified.
     """
+
     def __init__(self, regex=None, regex_mode="match", capture=None):
         self._regex = regex
         self._regex_mode = regex_mode
@@ -671,7 +734,9 @@ class MatchRemoteOutputEntry(GdbRemoteEn
             raise Exception("regex cannot be None")
 
         if not self._regex_mode in ["match", "search"]:
-            raise Exception("unsupported regex mode \"{}\": must be \"match\" or \"search\"".format(self._regex_mode))
+            raise Exception(
+                "unsupported regex mode \"{}\": must be \"match\" or \"search\"".format(
+                    self._regex_mode))
 
     def is_output_matcher(self):
         return True
@@ -692,7 +757,8 @@ class MatchRemoteOutputEntry(GdbRemoteEn
 
         # Validate that we haven't already matched.
         if self._matched:
-            raise Exception("invalid state - already matched, attempting to match again")
+            raise Exception(
+                "invalid state - already matched, attempting to match again")
 
         # If we don't have any content yet, we don't match.
         if len(accumulated_output) < 1:
@@ -704,9 +770,12 @@ class MatchRemoteOutputEntry(GdbRemoteEn
         elif self._regex_mode == "search":
             match = self._regex.search(accumulated_output)
         else:
-            raise Exception("Unexpected regex mode: {}".format(self._regex_mode))
+            raise Exception(
+                "Unexpected regex mode: {}".format(
+                    self._regex_mode))
 
-        # If we don't match, wait to try again after next $O content, or time out.
+        # If we don't match, wait to try again after next $O content, or time
+        # out.
         if not match:
             # print("re pattern \"{}\" did not match against \"{}\"".format(self._regex.pattern, accumulated_output))
             return context
@@ -721,7 +790,8 @@ class MatchRemoteOutputEntry(GdbRemoteEn
             for group_index, var_name in list(self._capture.items()):
                 capture_text = match.group(group_index)
                 if not capture_text:
-                    raise Exception("No content for group index {}".format(group_index))
+                    raise Exception(
+                        "No content for group index {}".format(group_index))
                 context[var_name] = capture_text
 
         return context
@@ -737,7 +807,7 @@ class GdbRemoteTestSequence(object):
 
     def add_log_lines(self, log_lines, remote_input_is_read):
         for line in log_lines:
-            if type(line) == str:
+            if isinstance(line, str):
                 # Handle log line import
                 # if self.logger:
                 #     self.logger.debug("processing log line: {}".format(line))
@@ -745,19 +815,27 @@ class GdbRemoteTestSequence(object):
                 if match:
                     playback_packet = match.group(2)
                     direction = match.group(1)
-                    if _is_packet_lldb_gdbserver_input(direction, remote_input_is_read):
+                    if _is_packet_lldb_gdbserver_input(
+                            direction, remote_input_is_read):
                         # Handle as something to send to the remote debug monitor.
                         # if self.logger:
                         #     self.logger.info("processed packet to send to remote: {}".format(playback_packet))
-                        self.entries.append(GdbRemoteEntry(is_send_to_remote=True, exact_payload=playback_packet))
+                        self.entries.append(
+                            GdbRemoteEntry(
+                                is_send_to_remote=True,
+                                exact_payload=playback_packet))
                     else:
                         # Log line represents content to be expected from the remote debug monitor.
                         # if self.logger:
                         #     self.logger.info("receiving packet from llgs, should match: {}".format(playback_packet))
-                        self.entries.append(GdbRemoteEntry(is_send_to_remote=False,exact_payload=playback_packet))
+                        self.entries.append(
+                            GdbRemoteEntry(
+                                is_send_to_remote=False,
+                                exact_payload=playback_packet))
                 else:
-                    raise Exception("failed to interpret log line: {}".format(line))
-            elif type(line) == dict:
+                    raise Exception(
+                        "failed to interpret log line: {}".format(line))
+            elif isinstance(line, dict):
                 entry_type = line.get("type", "regex_capture")
                 if entry_type == "regex_capture":
                     # Handle more explicit control over details via dictionary.
@@ -767,34 +845,50 @@ class GdbRemoteTestSequence(object):
                     expect_captures = line.get("expect_captures", None)
 
                     # Compile the regex.
-                    if regex and (type(regex) == str):
+                    if regex and (isinstance(regex, str)):
                         regex = re.compile(regex)
 
-                    if _is_packet_lldb_gdbserver_input(direction, remote_input_is_read):
+                    if _is_packet_lldb_gdbserver_input(
+                            direction, remote_input_is_read):
                         # Handle as something to send to the remote debug monitor.
                         # if self.logger:
                         #     self.logger.info("processed dict sequence to send to remote")
-                        self.entries.append(GdbRemoteEntry(is_send_to_remote=True, regex=regex, capture=capture, expect_captures=expect_captures))
+                        self.entries.append(
+                            GdbRemoteEntry(
+                                is_send_to_remote=True,
+                                regex=regex,
+                                capture=capture,
+                                expect_captures=expect_captures))
                     else:
                         # Log line represents content to be expected from the remote debug monitor.
                         # if self.logger:
                         #     self.logger.info("processed dict sequence to match receiving from remote")
-                        self.entries.append(GdbRemoteEntry(is_send_to_remote=False, regex=regex, capture=capture, expect_captures=expect_captures))
+                        self.entries.append(
+                            GdbRemoteEntry(
+                                is_send_to_remote=False,
+                                regex=regex,
+                                capture=capture,
+                                expect_captures=expect_captures))
                 elif entry_type == "multi_response":
                     self.entries.append(MultiResponseGdbRemoteEntry(line))
                 elif entry_type == "output_match":
 
                     regex = line.get("regex", None)
                     # Compile the regex.
-                    if regex and (type(regex) == str):
+                    if regex and (isinstance(regex, str)):
                         regex = re.compile(regex, re.DOTALL)
 
                     regex_mode = line.get("regex_mode", "match")
                     capture = line.get("capture", None)
-                    self.entries.append(MatchRemoteOutputEntry(regex=regex, regex_mode=regex_mode, capture=capture))
+                    self.entries.append(
+                        MatchRemoteOutputEntry(
+                            regex=regex,
+                            regex_mode=regex_mode,
+                            capture=capture))
                 else:
                     raise Exception("unknown entry type \"%s\"" % entry_type)
 
+
 def process_is_running(pid, unknown_value=True):
     """If possible, validate that the given pid represents a running process on the local system.
 
@@ -814,7 +908,9 @@ def process_is_running(pid, unknown_valu
         return the value provided by the unknown_value arg.
     """
     if not isinstance(pid, six.integer_types):
-        raise Exception("pid must be an integral type (actual type: %s)" % str(type(pid)))
+        raise Exception(
+            "pid must be an integral type (actual type: %s)" % str(
+                type(pid)))
 
     process_ids = []
 
@@ -824,10 +920,12 @@ def process_is_running(pid, unknown_valu
         return unknown_value
     elif platform.system() in ['Darwin', 'Linux', 'FreeBSD', 'NetBSD']:
         # Build the list of running process ids
-        output = subprocess.check_output("ps ax | awk '{ print $1; }'", shell=True)
+        output = subprocess.check_output(
+            "ps ax | awk '{ print $1; }'", shell=True)
         text_process_ids = output.split('\n')[1:]
         # Convert text pids to ints
-        process_ids = [int(text_pid) for text_pid in text_process_ids if text_pid != '']
+        process_ids = [int(text_pid)
+                       for text_pid in text_process_ids if text_pid != '']
     # elif {your_platform_here}:
     #   fill in process_ids as a list of int type process IDs running on
     #   the local system.

Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py Tue Sep  6 15:57:50 2016
@@ -7,6 +7,7 @@ from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
+
 class TestPlatformProcessConnect(gdbremote_testcase.GdbRemoteTestCaseBase):
     mydir = TestBase.compute_mydir(__file__)
 
@@ -19,10 +20,16 @@ class TestPlatformProcessConnect(gdbremo
         self.init_llgs_test(False)
 
         working_dir = lldb.remote_platform.GetWorkingDirectory()
-        err = lldb.remote_platform.Put(lldb.SBFileSpec(os.path.join(os.getcwd(), "a.out")),
-                                       lldb.SBFileSpec(os.path.join(working_dir, "a.out")))
+        err = lldb.remote_platform.Put(
+            lldb.SBFileSpec(
+                os.path.join(
+                    os.getcwd(), "a.out")), lldb.SBFileSpec(
+                os.path.join(
+                    working_dir, "a.out")))
         if err.Fail():
-            raise RuntimeError("Unable copy '%s' to '%s'.\n>>> %s" % (f, wd, err.GetCString()))
+            raise RuntimeError(
+                "Unable copy '%s' to '%s'.\n>>> %s" %
+                (f, wd, err.GetCString()))
 
         m = re.search("^(.*)://([^:/]*)", configuration.lldb_platform_url)
         protocol = m.group(1)
@@ -30,19 +37,34 @@ class TestPlatformProcessConnect(gdbremo
         unix_protocol = protocol.startswith("unix-")
         if unix_protocol:
             p = re.search("^(.*)-connect", protocol)
-            listen_url = "%s://%s" % (p.group(1), os.path.join(working_dir, "platform-%d.sock" % int(time.time())))
+            listen_url = "%s://%s" % (p.group(1),
+                                      os.path.join(working_dir,
+                                                   "platform-%d.sock" % int(time.time())))
         else:
             listen_url = "*:0"
 
         port_file = "%s/port" % working_dir
-        commandline_args = ["platform", "--listen", listen_url, "--socket-file", port_file, "--", "%s/a.out" % working_dir, "foo"]
-        self.spawnSubprocess(self.debug_monitor_exe, commandline_args, install_remote=False)
+        commandline_args = [
+            "platform",
+            "--listen",
+            listen_url,
+            "--socket-file",
+            port_file,
+            "--",
+            "%s/a.out" %
+            working_dir,
+            "foo"]
+        self.spawnSubprocess(
+            self.debug_monitor_exe,
+            commandline_args,
+            install_remote=False)
         self.addTearDownHook(self.cleanupSubprocesses)
 
         socket_id = lldbutil.wait_for_file_on_target(self, port_file)
 
         new_debugger = lldb.SBDebugger.Create()
         new_debugger.SetAsync(False)
+
         def del_debugger(new_debugger=new_debugger):
             del new_debugger
         self.addTearDownHook(del_debugger)
@@ -59,7 +81,10 @@ class TestPlatformProcessConnect(gdbremo
         command = "platform connect %s" % (connect_url)
         result = lldb.SBCommandReturnObject()
         new_interpreter.HandleCommand(command, result)
-        self.assertTrue(result.Succeeded(), "platform process connect failed: %s" % result.GetOutput())
+        self.assertTrue(
+            result.Succeeded(),
+            "platform process connect failed: %s" %
+            result.GetOutput())
 
         target = new_debugger.GetSelectedTarget()
         process = target.GetProcess()

Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/socket_packet_pump.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/socket_packet_pump.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/socket_packet_pump.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/socket_packet_pump.py Tue Sep  6 15:57:50 2016
@@ -2,7 +2,6 @@
 from __future__ import print_function
 
 
-
 import re
 import select
 import threading
@@ -11,6 +10,7 @@ import codecs
 
 from six.moves import queue
 
+
 def _handle_output_packet_string(packet_contents):
     if (not packet_contents) or (len(packet_contents) < 1):
         return None
@@ -21,12 +21,15 @@ def _handle_output_packet_string(packet_
     else:
         return packet_contents[1:].decode("hex")
 
+
 def _dump_queue(the_queue):
     while not the_queue.empty():
         print(codecs.encode(the_queue.get(True), "string_escape"))
         print("\n")
 
+
 class PumpQueues(object):
+
     def __init__(self):
         self._output_queue = queue.Queue()
         self._packet_queue = queue.Queue()
@@ -179,7 +182,8 @@ class SocketPacketPump(object):
                     # Likely a closed socket.  Done with the pump thread.
                     if self._logger:
                         self._logger.debug(
-                            "socket read failed, stopping pump read thread\n" + traceback.format_exc(3))
+                            "socket read failed, stopping pump read thread\n" +
+                            traceback.format_exc(3))
                     break
                 self._process_new_bytes(new_bytes)
 

Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/test/test_lldbgdbserverutils.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/test/test_lldbgdbserverutils.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/test/test_lldbgdbserverutils.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/test/test_lldbgdbserverutils.py Tue Sep  6 15:57:50 2016
@@ -1,7 +1,6 @@
 from __future__ import print_function
 
 
-
 import unittest2
 import os.path
 import re
@@ -11,6 +10,7 @@ from lldbgdbserverutils import *
 
 
 class TestLldbGdbServerUtils(unittest2.TestCase):
+
     def test_entry_exact_payload_match(self):
         entry = GdbRemoteEntry(is_send_to_remote=False, exact_payload="$OK#9a")
         entry.assert_match(self, "$OK#9a")
@@ -25,22 +25,38 @@ class TestLldbGdbServerUtils(unittest2.T
         self.assertIsNotNone(context)
 
     def test_entry_regex_matches(self):
-        entry = GdbRemoteEntry(is_send_to_remote=False, regex=re.compile(r"^\$QC([0-9a-fA-F]+)#"), capture={ 1:"thread_id" })
+        entry = GdbRemoteEntry(
+            is_send_to_remote=False,
+            regex=re.compile(r"^\$QC([0-9a-fA-F]+)#"),
+            capture={
+                1: "thread_id"})
         context = entry.assert_match(self, "$QC980#00")
 
     def test_entry_regex_saves_match(self):
-        entry = GdbRemoteEntry(is_send_to_remote=False, regex=re.compile(r"^\$QC([0-9a-fA-F]+)#"), capture={ 1:"thread_id" })
+        entry = GdbRemoteEntry(
+            is_send_to_remote=False,
+            regex=re.compile(r"^\$QC([0-9a-fA-F]+)#"),
+            capture={
+                1: "thread_id"})
         context = entry.assert_match(self, "$QC980#00")
         self.assertEqual(context["thread_id"], "980")
 
     def test_entry_regex_expect_captures_success(self):
-        context = { "thread_id":"980" }
-        entry = GdbRemoteEntry(is_send_to_remote=False, regex=re.compile(r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+)"), expect_captures={ 2:"thread_id" })
+        context = {"thread_id": "980"}
+        entry = GdbRemoteEntry(
+            is_send_to_remote=False,
+            regex=re.compile(r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+)"),
+            expect_captures={
+                2: "thread_id"})
         entry.assert_match(self, "$T11thread:980;", context=context)
 
     def test_entry_regex_expect_captures_raises_on_fail(self):
-        context = { "thread_id":"980" }
-        entry = GdbRemoteEntry(is_send_to_remote=False, regex=re.compile(r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+)"), expect_captures={ 2:"thread_id" })
+        context = {"thread_id": "980"}
+        entry = GdbRemoteEntry(
+            is_send_to_remote=False,
+            regex=re.compile(r"^\$T([0-9a-fA-F]{2})thread:([0-9a-fA-F]+)"),
+            expect_captures={
+                2: "thread_id"})
         try:
             entry.assert_match(self, "$T11thread:970;", context=context)
             self.fail()

Modified: lldb/trunk/packages/Python/lldbsuite/test/types/AbstractBase.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/types/AbstractBase.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/types/AbstractBase.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/types/AbstractBase.py Tue Sep  6 15:57:50 2016
@@ -4,15 +4,18 @@ Abstract base class of basic types provi
 
 from __future__ import print_function
 
-import os, time
+import os
+import time
 import re
 import lldb
 from lldbsuite.test.lldbtest import *
 import lldbsuite.test.lldbutil as lldbutil
 
+
 def Msg(var, val, using_frame_variable):
     return "'%s %s' matches the output (from compiled code): %s" % (
-        'frame variable --show-types' if using_frame_variable else 'expression' ,var, val)
+        'frame variable --show-types' if using_frame_variable else 'expression', var, val)
+
 
 class GenericTester(TestBase):
 
@@ -59,38 +62,56 @@ class GenericTester(TestBase):
     #==========================================================================#
 
     def build_and_run(self, source, atoms, bc=False, qd=False):
-        self.build_and_run_with_source_atoms_expr(source, atoms, expr=False, bc=bc, qd=qd)
+        self.build_and_run_with_source_atoms_expr(
+            source, atoms, expr=False, bc=bc, qd=qd)
 
     def build_and_run_expr(self, source, atoms, bc=False, qd=False):
-        self.build_and_run_with_source_atoms_expr(source, atoms, expr=True, bc=bc, qd=qd)
+        self.build_and_run_with_source_atoms_expr(
+            source, atoms, expr=True, bc=bc, qd=qd)
 
-    def build_and_run_with_source_atoms_expr(self, source, atoms, expr, bc=False, qd=False):
+    def build_and_run_with_source_atoms_expr(
+            self, source, atoms, expr, bc=False, qd=False):
         # See also Makefile and basic_type.cpp:177.
         if bc:
-            d = {'CXX_SOURCES': source, 'EXE': self.exe_name, 'CFLAGS_EXTRAS': '-DTEST_BLOCK_CAPTURED_VARS'}
+            d = {'CXX_SOURCES': source, 'EXE': self.exe_name,
+                 'CFLAGS_EXTRAS': '-DTEST_BLOCK_CAPTURED_VARS'}
         else:
             d = {'CXX_SOURCES': source, 'EXE': self.exe_name}
         self.build(dictionary=d)
         self.setTearDownCleanup(dictionary=d)
         if expr:
-            self.generic_type_expr_tester(self.exe_name, atoms, blockCaptured=bc, quotedDisplay=qd)
+            self.generic_type_expr_tester(
+                self.exe_name, atoms, blockCaptured=bc, quotedDisplay=qd)
         else:
-            self.generic_type_tester(self.exe_name, atoms, blockCaptured=bc, quotedDisplay=qd)
+            self.generic_type_tester(
+                self.exe_name,
+                atoms,
+                blockCaptured=bc,
+                quotedDisplay=qd)
 
     def process_launch_o(self, localPath):
-        # process launch command output redirect always goes to host the process is running on
+        # process launch command output redirect always goes to host the
+        # process is running on
         if lldb.remote_platform:
             # process launch -o requires a path that is valid on the target
             self.assertIsNotNone(lldb.remote_platform.GetWorkingDirectory())
-            remote_path = lldbutil.append_to_process_working_directory("lldb-stdout-redirect.txt")
-            self.runCmd('process launch -o {remote}'.format(remote=remote_path))
+            remote_path = lldbutil.append_to_process_working_directory(
+                "lldb-stdout-redirect.txt")
+            self.runCmd(
+                'process launch -o {remote}'.format(remote=remote_path))
             # copy remote_path to local host
             self.runCmd('platform get-file {remote} "{local}"'.format(
                 remote=remote_path, local=self.golden_filename))
         else:
-            self.runCmd('process launch -o "{local}"'.format(local=self.golden_filename))
+            self.runCmd(
+                'process launch -o "{local}"'.format(local=self.golden_filename))
 
-    def generic_type_tester(self, exe_name, atoms, quotedDisplay=False, blockCaptured=False):
+    def generic_type_tester(
+            self,
+            exe_name,
+            atoms,
+            quotedDisplay=False,
+            blockCaptured=False):
         """Test that variables with basic types are displayed correctly."""
 
         self.runCmd("file %s" % exe_name, CURRENT_EXECUTABLE_SET)
@@ -125,21 +146,30 @@ class GenericTester(TestBase):
         # always setting inlined breakpoints.
         self.runCmd('settings set target.inline-breakpoint-strategy always')
         # And add hooks to restore the settings during tearDown().
-        self.addTearDownHook(
-            lambda: self.runCmd("settings set target.inline-breakpoint-strategy headers"))
+        self.addTearDownHook(lambda: self.runCmd(
+            "settings set target.inline-breakpoint-strategy headers"))
 
         # Bring the program to the point where we can issue a series of
         # 'frame variable --show-types' command.
         if blockCaptured:
-            break_line = line_number ("basic_type.cpp", "// Break here to test block captured variables.")
+            break_line = line_number(
+                "basic_type.cpp",
+                "// Break here to test block captured variables.")
         else:
-            break_line = line_number ("basic_type.cpp", "// Here is the line we will break on to check variables.")
-        lldbutil.run_break_set_by_file_and_line (self, "basic_type.cpp", break_line, num_expected_locations=1, loc_exact=True)
+            break_line = line_number(
+                "basic_type.cpp",
+                "// Here is the line we will break on to check variables.")
+        lldbutil.run_break_set_by_file_and_line(
+            self,
+            "basic_type.cpp",
+            break_line,
+            num_expected_locations=1,
+            loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
         self.expect("process status", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = [" at basic_type.cpp:%d" % break_line,
-                       "stop reason = breakpoint"])
+                    substrs=[" at basic_type.cpp:%d" % break_line,
+                             "stop reason = breakpoint"])
 
         #self.runCmd("frame variable --show-types")
 
@@ -162,19 +192,22 @@ class GenericTester(TestBase):
                 self.fail(self.DATA_TYPE_GROKKED)
 
             # Expect the display type string to contain each and every atoms.
-            self.expect(dt,
-                        "Display type: '%s' must contain the type atoms: '%s'" %
-                        (dt, atoms),
-                        exe=False,
-                substrs = list(atoms))
+            self.expect(
+                dt, "Display type: '%s' must contain the type atoms: '%s'" %
+                (dt, atoms), exe=False, substrs=list(atoms))
 
             # The (var, val) pair must match, too.
             nv = ("%s = '%s'" if quotedDisplay else "%s = %s") % (var, val)
             self.expect(output, Msg(var, val, True), exe=False,
-                substrs = [nv])
+                        substrs=[nv])
         pass
 
-    def generic_type_expr_tester(self, exe_name, atoms, quotedDisplay=False, blockCaptured=False):
+    def generic_type_expr_tester(
+            self,
+            exe_name,
+            atoms,
+            quotedDisplay=False,
+            blockCaptured=False):
         """Test that variable expressions with basic types are evaluated correctly."""
 
         self.runCmd("file %s" % exe_name, CURRENT_EXECUTABLE_SET)
@@ -209,21 +242,30 @@ class GenericTester(TestBase):
         # always setting inlined breakpoints.
         self.runCmd('settings set target.inline-breakpoint-strategy always')
         # And add hooks to restore the settings during tearDown().
-        self.addTearDownHook(
-            lambda: self.runCmd("settings set target.inline-breakpoint-strategy headers"))
+        self.addTearDownHook(lambda: self.runCmd(
+            "settings set target.inline-breakpoint-strategy headers"))
 
         # Bring the program to the point where we can issue a series of
         # 'expr' command.
         if blockCaptured:
-            break_line = line_number ("basic_type.cpp", "// Break here to test block captured variables.")
+            break_line = line_number(
+                "basic_type.cpp",
+                "// Break here to test block captured variables.")
         else:
-            break_line = line_number ("basic_type.cpp", "// Here is the line we will break on to check variables.")
-        lldbutil.run_break_set_by_file_and_line (self, "basic_type.cpp", break_line, num_expected_locations=1, loc_exact=True)
+            break_line = line_number(
+                "basic_type.cpp",
+                "// Here is the line we will break on to check variables.")
+        lldbutil.run_break_set_by_file_and_line(
+            self,
+            "basic_type.cpp",
+            break_line,
+            num_expected_locations=1,
+            loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
         self.expect("process status", STOPPED_DUE_TO_BREAKPOINT,
-            substrs = [" at basic_type.cpp:%d" % break_line,
-                       "stop reason = breakpoint"])
+                    substrs=[" at basic_type.cpp:%d" % break_line,
+                             "stop reason = breakpoint"])
 
         #self.runCmd("frame variable --show-types")
 
@@ -246,14 +288,12 @@ class GenericTester(TestBase):
                 self.fail(self.DATA_TYPE_GROKKED)
 
             # Expect the display type string to contain each and every atoms.
-            self.expect(dt,
-                        "Display type: '%s' must contain the type atoms: '%s'" %
-                        (dt, atoms),
-                        exe=False,
-                substrs = list(atoms))
+            self.expect(
+                dt, "Display type: '%s' must contain the type atoms: '%s'" %
+                (dt, atoms), exe=False, substrs=list(atoms))
 
             # The val part must match, too.
             valPart = ("'%s'" if quotedDisplay else "%s") % val
             self.expect(output, Msg(var, val, False), exe=False,
-                substrs = [valPart])
+                        substrs=[valPart])
         pass

Modified: lldb/trunk/packages/Python/lldbsuite/test/types/HideTestFailures.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/types/HideTestFailures.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/types/HideTestFailures.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/types/HideTestFailures.py Tue Sep  6 15:57:50 2016
@@ -5,14 +5,16 @@ Test that variables of integer basic typ
 from __future__ import print_function
 
 
-
 import AbstractBase
 import sys
 import lldb
 from lldbsuite.test.lldbtest import *
 
 # rdar://problem/9649573
-# Capture the lldb and gdb-remote log files for test failures when run with no "-w" option
+# Capture the lldb and gdb-remote log files for test failures when run
+# with no "-w" option
+
+
 class DebugIntegerTypesFailures(TestBase):
 
     mydir = TestBase.compute_mydir(__file__)

Modified: lldb/trunk/packages/Python/lldbsuite/test/types/TestFloatTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/types/TestFloatTypes.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/types/TestFloatTypes.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/types/TestFloatTypes.py Tue Sep  6 15:57:50 2016
@@ -5,7 +5,6 @@ Test that variables of floating point ty
 from __future__ import print_function
 
 
-
 import AbstractBase
 import sys
 
@@ -14,6 +13,7 @@ from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
+
 class FloatTypesTestCase(AbstractBase.GenericTester):
 
     mydir = AbstractBase.GenericTester.compute_mydir(__file__)
@@ -23,7 +23,8 @@ class FloatTypesTestCase(AbstractBase.Ge
         AbstractBase.GenericTester.setUp(self)
         # disable "There is a running process, kill it and restart?" prompt
         self.runCmd("settings set auto-confirm true")
-        self.addTearDownHook(lambda: self.runCmd("settings clear auto-confirm"))
+        self.addTearDownHook(
+            lambda: self.runCmd("settings clear auto-confirm"))
 
     def test_float_type(self):
         """Test that float-type variables are displayed correctly."""

Modified: lldb/trunk/packages/Python/lldbsuite/test/types/TestFloatTypesExpr.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/types/TestFloatTypesExpr.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/types/TestFloatTypesExpr.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/types/TestFloatTypesExpr.py Tue Sep  6 15:57:50 2016
@@ -13,19 +13,22 @@ from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
+
 class FloatTypesExprTestCase(AbstractBase.GenericTester):
 
     mydir = AbstractBase.GenericTester.compute_mydir(__file__)
 
     # rdar://problem/8493023
-    # test/types failures for Test*TypesExpr.py: element offset computed wrong and sign error?
+    # test/types failures for Test*TypesExpr.py: element offset computed wrong
+    # and sign error?
 
     def setUp(self):
         # Call super's setUp().
         AbstractBase.GenericTester.setUp(self)
         # disable "There is a running process, kill it and restart?" prompt
         self.runCmd("settings set auto-confirm true")
-        self.addTearDownHook(lambda: self.runCmd("settings clear auto-confirm"))
+        self.addTearDownHook(
+            lambda: self.runCmd("settings clear auto-confirm"))
 
     def test_float_type(self):
         """Test that float-type variable expressions are evaluated correctly."""

Modified: lldb/trunk/packages/Python/lldbsuite/test/types/TestIntegerTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/types/TestIntegerTypes.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/types/TestIntegerTypes.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/types/TestIntegerTypes.py Tue Sep  6 15:57:50 2016
@@ -12,6 +12,7 @@ from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
+
 class IntegerTypesTestCase(AbstractBase.GenericTester):
 
     mydir = AbstractBase.GenericTester.compute_mydir(__file__)
@@ -21,7 +22,8 @@ class IntegerTypesTestCase(AbstractBase.
         AbstractBase.GenericTester.setUp(self)
         # disable "There is a running process, kill it and restart?" prompt
         self.runCmd("settings set auto-confirm true")
-        self.addTearDownHook(lambda: self.runCmd("settings clear auto-confirm"))
+        self.addTearDownHook(
+            lambda: self.runCmd("settings clear auto-confirm"))
 
     def test_char_type(self):
         """Test that char-type variables are displayed correctly."""
@@ -34,12 +36,14 @@ class IntegerTypesTestCase(AbstractBase.
 
     def test_unsigned_char_type(self):
         """Test that 'unsigned_char'-type variables are displayed correctly."""
-        self.build_and_run('unsigned_char.cpp', set(['unsigned', 'char']), qd=True)
+        self.build_and_run('unsigned_char.cpp', set(
+            ['unsigned', 'char']), qd=True)
 
     @skipUnlessDarwin
     def test_unsigned_char_type_from_block(self):
         """Test that 'unsigned char'-type variables are displayed correctly from a block."""
-        self.build_and_run('unsigned_char.cpp', set(['unsigned', 'char']), bc=True, qd=True)
+        self.build_and_run('unsigned_char.cpp', set(
+            ['unsigned', 'char']), bc=True, qd=True)
 
     def test_short_type(self):
         """Test that short-type variables are displayed correctly."""
@@ -57,7 +61,8 @@ class IntegerTypesTestCase(AbstractBase.
     @skipUnlessDarwin
     def test_unsigned_short_type_from_block(self):
         """Test that 'unsigned short'-type variables are displayed correctly from a block."""
-        self.build_and_run('unsigned_short.cpp', set(['unsigned', 'short']), bc=True)
+        self.build_and_run('unsigned_short.cpp', set(
+            ['unsigned', 'short']), bc=True)
 
     def test_int_type(self):
         """Test that int-type variables are displayed correctly."""
@@ -75,7 +80,8 @@ class IntegerTypesTestCase(AbstractBase.
     @skipUnlessDarwin
     def test_unsigned_int_type_from_block(self):
         """Test that 'unsigned int'-type variables are displayed correctly from a block."""
-        self.build_and_run('unsigned_int.cpp', set(['unsigned', 'int']), bc=True)
+        self.build_and_run('unsigned_int.cpp', set(
+            ['unsigned', 'int']), bc=True)
 
     def test_long_type(self):
         """Test that long-type variables are displayed correctly."""
@@ -93,7 +99,8 @@ class IntegerTypesTestCase(AbstractBase.
     @skipUnlessDarwin
     def test_unsigned_long_type_from_block(self):
         """Test that 'unsigned_long'-type variables are displayed correctly from a block."""
-        self.build_and_run('unsigned_long.cpp', set(['unsigned', 'long']), bc=True)
+        self.build_and_run('unsigned_long.cpp', set(
+            ['unsigned', 'long']), bc=True)
 
     def test_long_long_type(self):
         """Test that 'long long'-type variables are displayed correctly."""
@@ -106,9 +113,11 @@ class IntegerTypesTestCase(AbstractBase.
 
     def test_unsigned_long_long_type(self):
         """Test that 'unsigned long long'-type variables are displayed correctly."""
-        self.build_and_run('unsigned_long_long.cpp', set(['unsigned', 'long long']))
+        self.build_and_run('unsigned_long_long.cpp',
+                           set(['unsigned', 'long long']))
 
     @skipUnlessDarwin
     def test_unsigned_long_long_type_from_block(self):
         """Test that 'unsigned_long_long'-type variables are displayed correctly from a block."""
-        self.build_and_run('unsigned_long_long.cpp', set(['unsigned', 'long long']), bc=True)
+        self.build_and_run('unsigned_long_long.cpp', set(
+            ['unsigned', 'long long']), bc=True)

Modified: lldb/trunk/packages/Python/lldbsuite/test/types/TestIntegerTypesExpr.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/types/TestIntegerTypesExpr.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/types/TestIntegerTypesExpr.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/types/TestIntegerTypesExpr.py Tue Sep  6 15:57:50 2016
@@ -13,6 +13,7 @@ from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
+
 class IntegerTypesExprTestCase(AbstractBase.GenericTester):
 
     mydir = AbstractBase.GenericTester.compute_mydir(__file__)
@@ -22,7 +23,8 @@ class IntegerTypesExprTestCase(AbstractB
         AbstractBase.GenericTester.setUp(self)
         # disable "There is a running process, kill it and restart?" prompt
         self.runCmd("settings set auto-confirm true")
-        self.addTearDownHook(lambda: self.runCmd("settings clear auto-confirm"))
+        self.addTearDownHook(
+            lambda: self.runCmd("settings clear auto-confirm"))
 
     def test_char_type(self):
         """Test that char-type variable expressions are evaluated correctly."""
@@ -35,12 +37,14 @@ class IntegerTypesExprTestCase(AbstractB
 
     def test_unsigned_char_type(self):
         """Test that 'unsigned_char'-type variable expressions are evaluated correctly."""
-        self.build_and_run_expr('unsigned_char.cpp', set(['unsigned', 'char']), qd=True)
+        self.build_and_run_expr('unsigned_char.cpp', set(
+            ['unsigned', 'char']), qd=True)
 
     @skipUnlessDarwin
     def test_unsigned_char_type_from_block(self):
         """Test that 'unsigned char'-type variables are displayed correctly from a block."""
-        self.build_and_run_expr('unsigned_char.cpp', set(['unsigned', 'char']), bc=True, qd=True)
+        self.build_and_run_expr('unsigned_char.cpp', set(
+            ['unsigned', 'char']), bc=True, qd=True)
 
     def test_short_type(self):
         """Test that short-type variable expressions are evaluated correctly."""
@@ -53,12 +57,14 @@ class IntegerTypesExprTestCase(AbstractB
 
     def test_unsigned_short_type(self):
         """Test that 'unsigned_short'-type variable expressions are evaluated correctly."""
-        self.build_and_run_expr('unsigned_short.cpp', set(['unsigned', 'short']))
+        self.build_and_run_expr('unsigned_short.cpp',
+                                set(['unsigned', 'short']))
 
     @skipUnlessDarwin
     def test_unsigned_short_type_from_block(self):
         """Test that 'unsigned short'-type variables are displayed correctly from a block."""
-        self.build_and_run_expr('unsigned_short.cpp', set(['unsigned', 'short']), bc=True)
+        self.build_and_run_expr('unsigned_short.cpp', set(
+            ['unsigned', 'short']), bc=True)
 
     def test_int_type(self):
         """Test that int-type variable expressions are evaluated correctly."""
@@ -76,7 +82,8 @@ class IntegerTypesExprTestCase(AbstractB
     @skipUnlessDarwin
     def test_unsigned_int_type_from_block(self):
         """Test that 'unsigned int'-type variables are displayed correctly from a block."""
-        self.build_and_run_expr('unsigned_int.cpp', set(['unsigned', 'int']), bc=True)
+        self.build_and_run_expr(
+            'unsigned_int.cpp', set(['unsigned', 'int']), bc=True)
 
     def test_long_type(self):
         """Test that long-type variable expressions are evaluated correctly."""
@@ -94,7 +101,8 @@ class IntegerTypesExprTestCase(AbstractB
     @skipUnlessDarwin
     def test_unsigned_long_type_from_block(self):
         """Test that 'unsigned_long'-type variables are displayed correctly from a block."""
-        self.build_and_run_expr('unsigned_long.cpp', set(['unsigned', 'long']), bc=True)
+        self.build_and_run_expr('unsigned_long.cpp', set(
+            ['unsigned', 'long']), bc=True)
 
     def test_long_long_type(self):
         """Test that 'long long'-type variable expressions are evaluated correctly."""
@@ -107,9 +115,11 @@ class IntegerTypesExprTestCase(AbstractB
 
     def test_unsigned_long_long_type(self):
         """Test that 'unsigned long long'-type variable expressions are evaluated correctly."""
-        self.build_and_run_expr('unsigned_long_long.cpp', set(['unsigned', 'long long']))
+        self.build_and_run_expr('unsigned_long_long.cpp',
+                                set(['unsigned', 'long long']))
 
     @skipUnlessDarwin
     def test_unsigned_long_long_type_from_block(self):
         """Test that 'unsigned_long_long'-type variables are displayed correctly from a block."""
-        self.build_and_run_expr('unsigned_long_long.cpp', set(['unsigned', 'long long']), bc=True)
+        self.build_and_run_expr('unsigned_long_long.cpp', set(
+            ['unsigned', 'long long']), bc=True)

Modified: lldb/trunk/packages/Python/lldbsuite/test/types/TestRecursiveTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/types/TestRecursiveTypes.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/types/TestRecursiveTypes.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/types/TestRecursiveTypes.py Tue Sep  6 15:57:50 2016
@@ -5,12 +5,12 @@ Test that recursive types are handled co
 from __future__ import print_function
 
 
-
 import lldb
 import lldbsuite.test.lldbutil as lldbutil
 import sys
 from lldbsuite.test.lldbtest import *
 
+
 class RecursiveTypesTestCase(TestBase):
 
     mydir = TestBase.compute_mydir(__file__)
@@ -20,13 +20,16 @@ class RecursiveTypesTestCase(TestBase):
         TestBase.setUp(self)
         # disable "There is a running process, kill it and restart?" prompt
         self.runCmd("settings set auto-confirm true")
-        self.addTearDownHook(lambda: self.runCmd("settings clear auto-confirm"))
+        self.addTearDownHook(
+            lambda: self.runCmd("settings clear auto-confirm"))
         # Find the line number to break for main.c.
         self.line = line_number('recursive_type_main.cpp',
                                 '// Test at this line.')
 
-        self.d1 = {'CXX_SOURCES': 'recursive_type_main.cpp recursive_type_1.cpp'}
-        self.d2 = {'CXX_SOURCES': 'recursive_type_main.cpp recursive_type_2.cpp'}
+        self.d1 = {
+            'CXX_SOURCES': 'recursive_type_main.cpp recursive_type_1.cpp'}
+        self.d2 = {
+            'CXX_SOURCES': 'recursive_type_main.cpp recursive_type_2.cpp'}
 
     def test_recursive_type_1(self):
         """Test that recursive structs are displayed correctly."""
@@ -43,7 +46,12 @@ class RecursiveTypesTestCase(TestBase):
     def print_struct(self):
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        lldbutil.run_break_set_by_file_and_line (self, "recursive_type_main.cpp", self.line, num_expected_locations=-1, loc_exact=True)
+        lldbutil.run_break_set_by_file_and_line(
+            self,
+            "recursive_type_main.cpp",
+            self.line,
+            num_expected_locations=-1,
+            loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py Tue Sep  6 15:57:50 2016
@@ -3,13 +3,14 @@
 from __future__ import print_function
 
 
-
-import os, time
+import os
+import time
 import lldb
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
+
 @skipUnlessDarwin
 class AddDsymCommandCase(TestBase):
 
@@ -29,7 +30,8 @@ class AddDsymCommandCase(TestBase):
         self.generate_main_cpp(version=1)
         self.buildDsym(clean=True)
 
-        # Insert some delay and then call the program generator to produce main.cpp, version 2.
+        # Insert some delay and then call the program generator to produce
+        # main.cpp, version 2.
         time.sleep(5)
         self.generate_main_cpp(version=101)
         # Now call make again, but this time don't generate the dSYM.
@@ -60,15 +62,16 @@ class AddDsymCommandCase(TestBase):
         self.exe_name = 'a.out'
         self.do_add_dsym_with_dSYM_bundle(self.exe_name)
 
-
     def generate_main_cpp(self, version=0):
         """Generate main.cpp from main.cpp.template."""
         temp = os.path.join(os.getcwd(), self.template)
         with open(temp, 'r') as f:
             content = f.read()
 
-        new_content = content.replace('%ADD_EXTRA_CODE%',
-                                      'printf("This is version %d\\n");' % version)
+        new_content = content.replace(
+            '%ADD_EXTRA_CODE%',
+            'printf("This is version %d\\n");' %
+            version)
         src = os.path.join(os.getcwd(), self.source)
         with open(src, 'w') as f:
             f.write(new_content)
@@ -84,20 +87,33 @@ class AddDsymCommandCase(TestBase):
 
         wrong_path = os.path.join("%s.dSYM" % exe_name, "Contents")
         self.expect("add-dsym " + wrong_path, error=True,
-            substrs = ['invalid module path'])
+                    substrs=['invalid module path'])
 
-        right_path = os.path.join("%s.dSYM" % exe_name, "Contents", "Resources", "DWARF", exe_name)
+        right_path = os.path.join(
+            "%s.dSYM" %
+            exe_name,
+            "Contents",
+            "Resources",
+            "DWARF",
+            exe_name)
         self.expect("add-dsym " + right_path, error=True,
-            substrs = ['symbol file', 'does not match'])
+                    substrs=['symbol file', 'does not match'])
 
     def do_add_dsym_with_success(self, exe_name):
         """Test that the 'add-dsym' command informs the user about success."""
         self.runCmd("file " + exe_name, CURRENT_EXECUTABLE_SET)
 
-        # This time, the UUID should match and we expect some feedback from lldb.
-        right_path = os.path.join("%s.dSYM" % exe_name, "Contents", "Resources", "DWARF", exe_name)
+        # This time, the UUID should match and we expect some feedback from
+        # lldb.
+        right_path = os.path.join(
+            "%s.dSYM" %
+            exe_name,
+            "Contents",
+            "Resources",
+            "DWARF",
+            exe_name)
         self.expect("add-dsym " + right_path,
-            substrs = ['symbol file', 'has been added to'])
+                    substrs=['symbol file', 'has been added to'])
 
     def do_add_dsym_with_dSYM_bundle(self, exe_name):
         """Test that the 'add-dsym' command informs the user about success when loading files in bundles."""
@@ -106,4 +122,4 @@ class AddDsymCommandCase(TestBase):
         # This time, the UUID should be found inside the bundle
         right_path = "%s.dSYM" % exe_name
         self.expect("add-dsym " + right_path,
-            substrs = ['symbol file', 'has been added to'])
+                    substrs=['symbol file', 'has been added to'])

Modified: lldb/trunk/packages/Python/lldbsuite/test_event/build_exception.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test_event/build_exception.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test_event/build_exception.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test_event/build_exception.py Tue Sep  6 15:57:50 2016
@@ -1,8 +1,11 @@
 class BuildError(Exception):
+
     def __init__(self, called_process_error):
         super(BuildError, self).__init__("Error when building test subject")
-        self.command = called_process_error.lldb_extensions.get("command", "<command unavailable>")
-        self.build_error = called_process_error.lldb_extensions.get("stderr_content", "<error output unavailable>")
+        self.command = called_process_error.lldb_extensions.get(
+            "command", "<command unavailable>")
+        self.build_error = called_process_error.lldb_extensions.get(
+            "stderr_content", "<error output unavailable>")
 
     def __str__(self):
         return self.format_build_error(self.command, self.build_error)
@@ -10,5 +13,4 @@ class BuildError(Exception):
     @staticmethod
     def format_build_error(command, command_output):
         return "Error when building test subject.\n\nBuild Command:\n{}\n\nBuild Command Output:\n{}".format(
-            command,
-            command_output)
+            command, command_output)

Modified: lldb/trunk/packages/Python/lldbsuite/test_event/dotest_channels.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test_event/dotest_channels.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test_event/dotest_channels.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test_event/dotest_channels.py Tue Sep  6 15:57:50 2016
@@ -42,6 +42,7 @@ class UnpicklingForwardingReaderChannel(
     The bulk of this class is devoted to reading and parsing out
     the payload bytes.
     """
+
     def __init__(self, file_object, async_map, forwarding_func):
         asyncore.dispatcher.__init__(self, sock=file_object, map=async_map)
 
@@ -181,6 +182,7 @@ class UnpicklingForwardingListenerChanne
     one of the reasons for implementing with asyncore.  This listener shuts
     down once a single connection is made to it.
     """
+
     def __init__(self, async_map, host, port, backlog_count, forwarding_func):
         asyncore.dispatcher.__init__(self, map=async_map)
         self.create_socket(socket.AF_INET, socket.SOCK_STREAM)

Modified: lldb/trunk/packages/Python/lldbsuite/test_event/event_builder.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test_event/event_builder.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test_event/event_builder.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test_event/event_builder.py Tue Sep  6 15:57:50 2016
@@ -20,6 +20,7 @@ import traceback
 # LLDB modules
 from . import build_exception
 
+
 class EventBuilder(object):
     """Helper class to build test result event dictionaries."""
 
@@ -95,7 +96,8 @@ class EventBuilder(object):
     def _assert_is_python_sourcefile(test_filename):
         if test_filename is not None:
             if not test_filename.endswith(".py"):
-                raise Exception("source python filename has unexpected extension: {}".format(test_filename))
+                raise Exception(
+                    "source python filename has unexpected extension: {}".format(test_filename))
         return test_filename
 
     @staticmethod
@@ -113,9 +115,11 @@ class EventBuilder(object):
         # Determine the filename for the test case.  If there is an attribute
         # for it, use it.  Otherwise, determine from the TestCase class path.
         if hasattr(test, "test_filename"):
-            test_filename = EventBuilder._assert_is_python_sourcefile(test.test_filename)
+            test_filename = EventBuilder._assert_is_python_sourcefile(
+                test.test_filename)
         else:
-            test_filename = EventBuilder._assert_is_python_sourcefile(inspect.getsourcefile(test.__class__))
+            test_filename = EventBuilder._assert_is_python_sourcefile(
+                inspect.getsourcefile(test.__class__))
 
         event = EventBuilder.bare_event(event_type)
         event.update({
@@ -352,7 +356,8 @@ class EventBuilder(object):
         event = EventBuilder.bare_event(EventBuilder.TYPE_JOB_RESULT)
         event["status"] = EventBuilder.STATUS_ERROR
         if test_filename is not None:
-            event["test_filename"] = EventBuilder._assert_is_python_sourcefile(test_filename)
+            event["test_filename"] = EventBuilder._assert_is_python_sourcefile(
+                test_filename)
         if exception is not None and "__class__" in dir(exception):
             event["issue_class"] = exception.__class__
         event["issue_message"] = exception
@@ -390,7 +395,8 @@ class EventBuilder(object):
         if exception_description is not None:
             event["exception_description"] = exception_description
         if test_filename is not None:
-            event["test_filename"] = EventBuilder._assert_is_python_sourcefile(test_filename)
+            event["test_filename"] = EventBuilder._assert_is_python_sourcefile(
+                test_filename)
         if command_line is not None:
             event["command_line"] = command_line
         return event
@@ -414,7 +420,8 @@ class EventBuilder(object):
         if worker_index is not None:
             event["worker_index"] = int(worker_index)
         if test_filename is not None:
-            event["test_filename"] = EventBuilder._assert_is_python_sourcefile(test_filename)
+            event["test_filename"] = EventBuilder._assert_is_python_sourcefile(
+                test_filename)
         if command_line is not None:
             event["command_line"] = command_line
         return event

Modified: lldb/trunk/packages/Python/lldbsuite/test_event/formatter/__init__.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test_event/formatter/__init__.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test_event/formatter/__init__.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test_event/formatter/__init__.py Tue Sep  6 15:57:50 2016
@@ -76,7 +76,8 @@ def create_results_formatter(config):
         # we lose the test result info.
         read_bytes = sock.recv(1)
         if read_bytes is None or (len(read_bytes) < 1) or (read_bytes != b'*'):
-            raise Exception("listening socket did not respond with ack byte: response={}".format(read_bytes))
+            raise Exception(
+                "listening socket did not respond with ack byte: response={}".format(read_bytes))
 
         return sock, lambda: socket_closer(sock)
 

Modified: lldb/trunk/packages/Python/lldbsuite/test_event/formatter/curses.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test_event/formatter/curses.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test_event/formatter/curses.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test_event/formatter/curses.py Tue Sep  6 15:57:50 2016
@@ -38,7 +38,10 @@ class Curses(results_formatter.ResultsFo
         self.results = list()
         try:
             self.main_window = lldbcurses.intialize_curses()
-            self.main_window.add_key_action('\t', self.main_window.select_next_first_responder, "Switch between views that can respond to keyboard input")
+            self.main_window.add_key_action(
+                '\t',
+                self.main_window.select_next_first_responder,
+                "Switch between views that can respond to keyboard input")
             self.main_window.refresh()
             self.job_panel = None
             self.results_panel = None
@@ -87,10 +90,15 @@ class Curses(results_formatter.ResultsFo
         selected_idx = self.results_panel.get_selected_idx()
         if selected_idx >= 0 and selected_idx < len(self.results):
             if self.info_panel is None:
-                info_frame = self.results_panel.get_contained_rect(top_inset=10, left_inset=10, right_inset=10, height=30)
-                self.info_panel = lldbcurses.BoxedPanel(info_frame, "Result Details")
-                # Add a key action for any key that will hide this panel when any key is pressed
-                self.info_panel.add_key_action(-1, self.hide_info_panel, 'Hide the info panel')
+                info_frame = self.results_panel.get_contained_rect(
+                    top_inset=10, left_inset=10, right_inset=10, height=30)
+                self.info_panel = lldbcurses.BoxedPanel(
+                    info_frame, "Result Details")
+                # Add a key action for any key that will hide this panel when
+                # any key is pressed
+                self.info_panel.add_key_action(-1,
+                                               self.hide_info_panel,
+                                               'Hide the info panel')
                 self.info_panel.top()
             else:
                 self.info_panel.show()
@@ -98,9 +106,15 @@ class Curses(results_formatter.ResultsFo
             self.main_window.push_first_responder(self.info_panel)
             test_start = self.results[selected_idx][0]
             test_result = self.results[selected_idx][1]
-            self.info_panel.set_line(0, "File: %s" % (test_start['test_filename']))
-            self.info_panel.set_line(1, "Test: %s.%s" % (test_start['test_class'], test_start['test_name']))
-            self.info_panel.set_line(2, "Time: %s" % (test_result['elapsed_time']))
+            self.info_panel.set_line(
+                0, "File: %s" %
+                (test_start['test_filename']))
+            self.info_panel.set_line(
+                1, "Test: %s.%s" %
+                (test_start['test_class'], test_start['test_name']))
+            self.info_panel.set_line(
+                2, "Time: %s" %
+                (test_result['elapsed_time']))
             self.info_panel.set_line(3, "Status: %s" % (test_result['status']))
 
     def hide_info_panel(self):
@@ -110,7 +124,8 @@ class Curses(results_formatter.ResultsFo
 
     def toggle_status(self, status):
         if status:
-            # Toggle showing and hiding results whose status matches "status" in "Results" window
+            # Toggle showing and hiding results whose status matches "status"
+            # in "Results" window
             if status in self.hide_status_list:
                 self.hide_status_list.remove(status)
             else:
@@ -127,7 +142,13 @@ class Curses(results_formatter.ResultsFo
             if status in self.hide_status_list:
                 continue
             name = test_result['test_class'] + '.' + test_result['test_name']
-            self.results_panel.append_line('%s (%6.2f sec) %s' % (self.status_to_short_str(status, test_result), test_result['elapsed_time'], name))
+            self.results_panel.append_line(
+                '%s (%6.2f sec) %s' %
+                (self.status_to_short_str(
+                    status,
+                    test_result),
+                    test_result['elapsed_time'],
+                    name))
         if update:
             self.main_window.refresh()
 
@@ -145,9 +166,14 @@ class Curses(results_formatter.ResultsFo
                     #print(str(test_event), file=self.events_file)
                     event = test_event['event']
                     if self.status_panel:
-                        self.status_panel.update_status('time', str(datetime.timedelta(seconds=math.floor(time.time() - self.start_time))))
+                        self.status_panel.update_status(
+                            'time', str(
+                                datetime.timedelta(
+                                    seconds=math.floor(
+                                        time.time() - self.start_time))))
                     if event == 'test_start':
-                        name = test_event['test_class'] + '.' + test_event['test_name']
+                        name = test_event['test_class'] + \
+                            '.' + test_event['test_name']
                         self.job_tests[worker_index] = test_event
                         if 'pid' in test_event:
                             line = 'pid: %5d ' % (test_event['pid']) + name
@@ -163,14 +189,20 @@ class Curses(results_formatter.ResultsFo
                         else:
                             line = ''
                         self.job_panel.set_line(worker_index, line)
-                        name = test_event['test_class'] + '.' + test_event['test_name']
-                        elapsed_time = test_event['event_time'] - self.job_tests[worker_index]['event_time']
-                        if not status in self.hide_status_list:
-                            self.results_panel.append_line('%s (%6.2f sec) %s' % (self.status_to_short_str(status, test_event), elapsed_time, name))
+                        name = test_event['test_class'] + \
+                            '.' + test_event['test_name']
+                        elapsed_time = test_event[
+                            'event_time'] - self.job_tests[worker_index]['event_time']
+                        if status not in self.hide_status_list:
+                            self.results_panel.append_line(
+                                '%s (%6.2f sec) %s' %
+                                (self.status_to_short_str(
+                                    status, test_event), elapsed_time, name))
                         self.main_window.refresh()
                         # Append the result pairs
                         test_event['elapsed_time'] = elapsed_time
-                        self.results.append([self.job_tests[worker_index], test_event])
+                        self.results.append(
+                            [self.job_tests[worker_index], test_event])
                         self.job_tests[worker_index] = ''
                     elif event == 'job_begin':
                         self.jobs[worker_index] = test_event
@@ -185,40 +217,121 @@ class Curses(results_formatter.ResultsFo
                     elif event == 'initialize':
                         self.initialize_event = test_event
                         num_jobs = test_event['worker_count']
-                        job_frame = self.main_window.get_contained_rect(height=num_jobs+2)
-                        results_frame = self.main_window.get_contained_rect(top_inset=num_jobs+2, bottom_inset=1)
-                        status_frame = self.main_window.get_contained_rect(height=1, top_inset=self.main_window.get_size().h-1)
-                        self.job_panel = lldbcurses.BoxedPanel(frame=job_frame, title="Jobs")
-                        self.results_panel = lldbcurses.BoxedPanel(frame=results_frame, title="Results")
-
-                        self.results_panel.add_key_action(curses.KEY_UP,    self.results_panel.select_prev      , "Select the previous list entry")
-                        self.results_panel.add_key_action(curses.KEY_DOWN,  self.results_panel.select_next      , "Select the next list entry")
-                        self.results_panel.add_key_action(curses.KEY_HOME,  self.results_panel.scroll_begin     , "Scroll to the start of the list")
-                        self.results_panel.add_key_action(curses.KEY_END,   self.results_panel.scroll_end       , "Scroll to the end of the list")
-                        self.results_panel.add_key_action(curses.KEY_ENTER, self.show_info_panel                , "Display info for the selected result item")
-                        self.results_panel.add_key_action('.', lambda : self.toggle_status(EventBuilder.STATUS_SUCCESS)           , "Toggle showing/hiding tests whose status is 'success'")
-                        self.results_panel.add_key_action('e', lambda : self.toggle_status(EventBuilder.STATUS_ERROR)             , "Toggle showing/hiding tests whose status is 'error'")
-                        self.results_panel.add_key_action('f', lambda : self.toggle_status(EventBuilder.STATUS_FAILURE)           , "Toggle showing/hiding tests whose status is 'failure'")
-                        self.results_panel.add_key_action('s', lambda : self.toggle_status(EventBuilder.STATUS_SKIP)              , "Toggle showing/hiding tests whose status is 'skip'")
-                        self.results_panel.add_key_action('x', lambda : self.toggle_status(EventBuilder.STATUS_EXPECTED_FAILURE)  , "Toggle showing/hiding tests whose status is 'expected_failure'")
-                        self.results_panel.add_key_action('?', lambda : self.toggle_status(EventBuilder.STATUS_UNEXPECTED_SUCCESS), "Toggle showing/hiding tests whose status is 'unexpected_success'")
-                        self.status_panel = lldbcurses.StatusPanel(frame=status_frame)
+                        job_frame = self.main_window.get_contained_rect(
+                            height=num_jobs + 2)
+                        results_frame = self.main_window.get_contained_rect(
+                            top_inset=num_jobs + 2, bottom_inset=1)
+                        status_frame = self.main_window.get_contained_rect(
+                            height=1, top_inset=self.main_window.get_size().h - 1)
+                        self.job_panel = lldbcurses.BoxedPanel(
+                            frame=job_frame, title="Jobs")
+                        self.results_panel = lldbcurses.BoxedPanel(
+                            frame=results_frame, title="Results")
+
+                        self.results_panel.add_key_action(
+                            curses.KEY_UP,
+                            self.results_panel.select_prev,
+                            "Select the previous list entry")
+                        self.results_panel.add_key_action(
+                            curses.KEY_DOWN, self.results_panel.select_next, "Select the next list entry")
+                        self.results_panel.add_key_action(
+                            curses.KEY_HOME,
+                            self.results_panel.scroll_begin,
+                            "Scroll to the start of the list")
+                        self.results_panel.add_key_action(
+                            curses.KEY_END, self.results_panel.scroll_end, "Scroll to the end of the list")
+                        self.results_panel.add_key_action(
+                            curses.KEY_ENTER,
+                            self.show_info_panel,
+                            "Display info for the selected result item")
+                        self.results_panel.add_key_action(
+                            '.',
+                            lambda: self.toggle_status(
+                                EventBuilder.STATUS_SUCCESS),
+                            "Toggle showing/hiding tests whose status is 'success'")
+                        self.results_panel.add_key_action(
+                            'e',
+                            lambda: self.toggle_status(
+                                EventBuilder.STATUS_ERROR),
+                            "Toggle showing/hiding tests whose status is 'error'")
+                        self.results_panel.add_key_action(
+                            'f',
+                            lambda: self.toggle_status(
+                                EventBuilder.STATUS_FAILURE),
+                            "Toggle showing/hiding tests whose status is 'failure'")
+                        self.results_panel.add_key_action('s', lambda: self.toggle_status(
+                            EventBuilder.STATUS_SKIP), "Toggle showing/hiding tests whose status is 'skip'")
+                        self.results_panel.add_key_action(
+                            'x',
+                            lambda: self.toggle_status(
+                                EventBuilder.STATUS_EXPECTED_FAILURE),
+                            "Toggle showing/hiding tests whose status is 'expected_failure'")
+                        self.results_panel.add_key_action(
+                            '?',
+                            lambda: self.toggle_status(
+                                EventBuilder.STATUS_UNEXPECTED_SUCCESS),
+                            "Toggle showing/hiding tests whose status is 'unexpected_success'")
+                        self.status_panel = lldbcurses.StatusPanel(
+                            frame=status_frame)
 
                         self.main_window.add_child(self.job_panel)
                         self.main_window.add_child(self.results_panel)
                         self.main_window.add_child(self.status_panel)
-                        self.main_window.set_first_responder(self.results_panel)
+                        self.main_window.set_first_responder(
+                            self.results_panel)
 
-                        self.status_panel.add_status_item(name="time", title="Elapsed", format="%s", width=20, value="0:00:00", update=False)
-                        self.status_panel.add_status_item(name=EventBuilder.STATUS_SUCCESS, title="Success", format="%u", width=20, value=0, update=False)
-                        self.status_panel.add_status_item(name=EventBuilder.STATUS_FAILURE, title="Failure", format="%u", width=20, value=0, update=False)
-                        self.status_panel.add_status_item(name=EventBuilder.STATUS_ERROR, title="Error", format="%u", width=20, value=0, update=False)
-                        self.status_panel.add_status_item(name=EventBuilder.STATUS_SKIP, title="Skipped", format="%u", width=20, value=0, update=True)
-                        self.status_panel.add_status_item(name=EventBuilder.STATUS_EXPECTED_FAILURE, title="Expected Failure", format="%u", width=30, value=0, update=False)
-                        self.status_panel.add_status_item(name=EventBuilder.STATUS_UNEXPECTED_SUCCESS, title="Unexpected Success", format="%u", width=30, value=0, update=False)
+                        self.status_panel.add_status_item(
+                            name="time",
+                            title="Elapsed",
+                            format="%s",
+                            width=20,
+                            value="0:00:00",
+                            update=False)
+                        self.status_panel.add_status_item(
+                            name=EventBuilder.STATUS_SUCCESS,
+                            title="Success",
+                            format="%u",
+                            width=20,
+                            value=0,
+                            update=False)
+                        self.status_panel.add_status_item(
+                            name=EventBuilder.STATUS_FAILURE,
+                            title="Failure",
+                            format="%u",
+                            width=20,
+                            value=0,
+                            update=False)
+                        self.status_panel.add_status_item(
+                            name=EventBuilder.STATUS_ERROR,
+                            title="Error",
+                            format="%u",
+                            width=20,
+                            value=0,
+                            update=False)
+                        self.status_panel.add_status_item(
+                            name=EventBuilder.STATUS_SKIP,
+                            title="Skipped",
+                            format="%u",
+                            width=20,
+                            value=0,
+                            update=True)
+                        self.status_panel.add_status_item(
+                            name=EventBuilder.STATUS_EXPECTED_FAILURE,
+                            title="Expected Failure",
+                            format="%u",
+                            width=30,
+                            value=0,
+                            update=False)
+                        self.status_panel.add_status_item(
+                            name=EventBuilder.STATUS_UNEXPECTED_SUCCESS,
+                            title="Unexpected Success",
+                            format="%u",
+                            width=30,
+                            value=0,
+                            update=False)
                         self.main_window.refresh()
                     elif event == 'terminate':
-                        #self.main_window.key_event_loop()
+                        # self.main_window.key_event_loop()
                         lldbcurses.terminate_curses()
                         check_for_one_key = False
                         self.using_terminal = False

Modified: lldb/trunk/packages/Python/lldbsuite/test_event/formatter/pickled.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test_event/formatter/pickled.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test_event/formatter/pickled.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test_event/formatter/pickled.py Tue Sep  6 15:57:50 2016
@@ -31,21 +31,29 @@ class RawPickledFormatter(ResultsFormatt
         return parser
 
     class StreamSerializer(object):
+
         @staticmethod
         def serialize(test_event, out_file):
-            # Send it as {serialized_length_of_serialized_bytes}{serialized_bytes}
+            # Send it as
+            # {serialized_length_of_serialized_bytes}{serialized_bytes}
             import struct
             msg = cPickle.dumps(test_event)
             packet = struct.pack("!I%ds" % len(msg), len(msg), msg)
             out_file.send(packet)
 
     class BlockSerializer(object):
+
         @staticmethod
         def serialize(test_event, out_file):
             cPickle.dump(test_event, out_file)
 
     def __init__(self, out_file, options, file_is_stream):
-        super(RawPickledFormatter, self).__init__(out_file, options, file_is_stream)
+        super(
+            RawPickledFormatter,
+            self).__init__(
+            out_file,
+            options,
+            file_is_stream)
         self.pid = os.getpid()
         if file_is_stream:
             self.serializer = self.StreamSerializer()

Modified: lldb/trunk/packages/Python/lldbsuite/test_event/formatter/results_formatter.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test_event/formatter/results_formatter.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test_event/formatter/results_formatter.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test_event/formatter/results_formatter.py Tue Sep  6 15:57:50 2016
@@ -341,7 +341,8 @@ class ResultsFormatter(object):
                     # started test for the given worker index.
                     status = test_event["status"]
                     self.result_status_counts[status] += 1
-                    # Clear the most recently started test for the related worker.
+                    # Clear the most recently started test for the related
+                    # worker.
                     worker_index = test_event.get("worker_index", None)
                     if worker_index is not None:
                         self.started_tests_by_worker.pop(worker_index, None)
@@ -688,7 +689,7 @@ class ResultsFormatter(object):
              # prevent buildbots from thinking it is an issue when scanning
              # for TIMEOUT.
              "Expected Timeout", True, "EXPECTED TIME-OUT"]
-            ]
+        ]
 
         # Partition all the events by test result status
         result_events_by_status = self._partition_results_by_status(

Modified: lldb/trunk/packages/Python/lldbsuite/test_event/formatter/xunit.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test_event/formatter/xunit.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test_event/formatter/xunit.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test_event/formatter/xunit.py Tue Sep  6 15:57:50 2016
@@ -180,7 +180,7 @@ class XunitFormatter(ResultsFormatter):
             "unexpected_successes": [],
             "expected_failures": [],
             "all": []
-            }
+        }
 
         self.status_handlers = {
             EventBuilder.STATUS_SUCCESS: self._handle_success,
@@ -197,9 +197,11 @@ class XunitFormatter(ResultsFormatter):
                 self._handle_exceptional_exit,
             EventBuilder.STATUS_TIMEOUT:
                 self._handle_timeout
-            }
+        }
 
-    RESULT_TYPES = {EventBuilder.TYPE_TEST_RESULT, EventBuilder.TYPE_JOB_RESULT}
+    RESULT_TYPES = {
+        EventBuilder.TYPE_TEST_RESULT,
+        EventBuilder.TYPE_JOB_RESULT}
 
     def handle_event(self, test_event):
         super(XunitFormatter, self).handle_event(test_event)

Modified: lldb/trunk/packages/Python/lldbsuite/test_event/test/src/TestCatchInvalidDecorator.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test_event/test/src/TestCatchInvalidDecorator.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test_event/test/src/TestCatchInvalidDecorator.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test_event/test/src/TestCatchInvalidDecorator.py Tue Sep  6 15:57:50 2016
@@ -63,7 +63,7 @@ def _filter_error_results(events):
         for event in events
         if event.get("event", None) in ["job_result", "test_result"] and
         event.get("status", None) == "error"
-        ]
+    ]
 
 
 if __name__ == "__main__":

Modified: lldb/trunk/packages/Python/lldbsuite/test_event/test/src/event_collector.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test_event/test/src/event_collector.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test_event/test/src/event_collector.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test_event/test/src/event_collector.py Tue Sep  6 15:57:50 2016
@@ -65,9 +65,9 @@ def collect_events_whole_file(test_filen
         "--inferior",
         "--results-formatter=lldbsuite.test_event.formatter.pickled.RawPickledFormatter",
         "--results-file={}".format(events_filename),
-        "-p", os.path.basename(test_filename),
-        os.path.dirname(test_filename)
-        ]
+        "-p",
+        os.path.basename(test_filename),
+        os.path.dirname(test_filename)]
     return _collect_events_with_command(command, events_filename)
 
 
@@ -79,7 +79,7 @@ def collect_events_for_directory_with_fi
         "--inferior",
         "--results-formatter=lldbsuite.test_event.formatter.pickled.RawPickledFormatter",
         "--results-file={}".format(events_filename),
-        "-f", filter_desc,
-        os.path.dirname(test_filename)
-        ]
+        "-f",
+        filter_desc,
+        os.path.dirname(test_filename)]
     return _collect_events_with_command(command, events_filename)

Modified: lldb/trunk/scripts/Python/android/host_art_bt.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/android/host_art_bt.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/android/host_art_bt.py (original)
+++ lldb/trunk/scripts/Python/android/host_art_bt.py Tue Sep  6 15:57:50 2016
@@ -10,183 +10,228 @@ import re
 
 import lldb
 
+
 def host_art_bt(debugger, command, result, internal_dict):
-  prettified_frames = []
-  lldb_frame_index = 0
-  art_frame_index = 0
-  target = debugger.GetSelectedTarget()
-  process = target.GetProcess()
-  thread = process.GetSelectedThread()
-  while lldb_frame_index < thread.GetNumFrames():
-    frame = thread.GetFrameAtIndex(lldb_frame_index)
-    if frame.GetModule() and re.match(r'JIT\(.*?\)', frame.GetModule().GetFileSpec().GetFilename()):
-      # Compiled Java frame
-
-      # Get function/filename/lineno from symbol context
-      symbol = frame.GetSymbol()
-      if not symbol:
-        print 'No symbol info for compiled Java frame: ', frame
-        sys.exit(1)
-      line_entry = frame.GetLineEntry()
-      prettified_frames.append({
-        'function': symbol.GetName(),
-        'file'    : str(line_entry.GetFileSpec()) if line_entry else None,
-        'line'    : line_entry.GetLine() if line_entry else -1
-      })
-
-      # Skip art frames
-      while True:
-        art_stack_visitor = frame.EvaluateExpression("""struct GetStackVisitor : public StackVisitor { GetStackVisitor(int depth_) : StackVisitor(Thread::Current(), NULL), depth(depth_) {} bool VisitFrame() { if (cur_depth_ == depth) { return false; } else { return true; } } int depth; }; GetStackVisitor visitor(""" + str(art_frame_index) + """); visitor.WalkStack(true); visitor""")
-        art_method = frame.EvaluateExpression(art_stack_visitor.GetName() + """.GetMethod()""")
-        if art_method.GetValueAsUnsigned() != 0:
-          art_method_name = frame.EvaluateExpression("""art::PrettyMethod(""" + art_method.GetName() + """, true)""")
-          art_method_name_data = frame.EvaluateExpression(art_method_name.GetName() + """.c_str()""").GetValueAsUnsigned()
-          art_method_name_size = frame.EvaluateExpression(art_method_name.GetName() + """.length()""").GetValueAsUnsigned()
-          error = lldb.SBError()
-          art_method_name = process.ReadCStringFromMemory(art_method_name_data, art_method_name_size + 1, error)
-          if not error.Success:
-            print 'Failed to read method name'
-            sys.exit(1)
-          if art_method_name != symbol.GetName():
-            print 'Function names in native symbol and art runtime stack do not match: ', symbol.GetName(), ' != ', art_method_name
-          art_frame_index = art_frame_index + 1
-          break
-        art_frame_index = art_frame_index + 1
-
-      # Skip native frames
-      lldb_frame_index = lldb_frame_index + 1
-      if lldb_frame_index < thread.GetNumFrames():
+    prettified_frames = []
+    lldb_frame_index = 0
+    art_frame_index = 0
+    target = debugger.GetSelectedTarget()
+    process = target.GetProcess()
+    thread = process.GetSelectedThread()
+    while lldb_frame_index < thread.GetNumFrames():
         frame = thread.GetFrameAtIndex(lldb_frame_index)
-        if frame.GetModule() and re.match(r'JIT\(.*?\)', frame.GetModule().GetFileSpec().GetFilename()):
-          # Another compile Java frame
-          # Don't skip; leave it to the next iteration
-          continue
-        elif frame.GetSymbol() and (frame.GetSymbol().GetName() == 'art_quick_invoke_stub' or frame.GetSymbol().GetName() == 'art_quick_invoke_static_stub'):
-          # art_quick_invoke_stub / art_quick_invoke_static_stub
-          # Skip until we get past the next ArtMethod::Invoke()
-          while True:
+        if frame.GetModule() and re.match(r'JIT\(.*?\)',
+                                          frame.GetModule().GetFileSpec().GetFilename()):
+            # Compiled Java frame
+
+            # Get function/filename/lineno from symbol context
+            symbol = frame.GetSymbol()
+            if not symbol:
+                print 'No symbol info for compiled Java frame: ', frame
+                sys.exit(1)
+            line_entry = frame.GetLineEntry()
+            prettified_frames.append({
+                'function': symbol.GetName(),
+                'file': str(line_entry.GetFileSpec()) if line_entry else None,
+                'line': line_entry.GetLine() if line_entry else -1
+            })
+
+            # Skip art frames
+            while True:
+                art_stack_visitor = frame.EvaluateExpression(
+                    """struct GetStackVisitor : public StackVisitor { GetStackVisitor(int depth_) : StackVisitor(Thread::Current(), NULL), depth(depth_) {} bool VisitFrame() { if (cur_depth_ == depth) { return false; } else { return true; } } int depth; }; GetStackVisitor visitor(""" +
+                    str(art_frame_index) +
+                    """); visitor.WalkStack(true); visitor""")
+                art_method = frame.EvaluateExpression(
+                    art_stack_visitor.GetName() + """.GetMethod()""")
+                if art_method.GetValueAsUnsigned() != 0:
+                    art_method_name = frame.EvaluateExpression(
+                        """art::PrettyMethod(""" + art_method.GetName() + """, true)""")
+                    art_method_name_data = frame.EvaluateExpression(
+                        art_method_name.GetName() + """.c_str()""").GetValueAsUnsigned()
+                    art_method_name_size = frame.EvaluateExpression(
+                        art_method_name.GetName() + """.length()""").GetValueAsUnsigned()
+                    error = lldb.SBError()
+                    art_method_name = process.ReadCStringFromMemory(
+                        art_method_name_data, art_method_name_size + 1, error)
+                    if not error.Success:
+                        print 'Failed to read method name'
+                        sys.exit(1)
+                    if art_method_name != symbol.GetName():
+                        print 'Function names in native symbol and art runtime stack do not match: ', symbol.GetName(), ' != ', art_method_name
+                    art_frame_index = art_frame_index + 1
+                    break
+                art_frame_index = art_frame_index + 1
+
+            # Skip native frames
             lldb_frame_index = lldb_frame_index + 1
-            if lldb_frame_index >= thread.GetNumFrames():
-              print 'ArtMethod::Invoke not found below art_quick_invoke_stub/art_quick_invoke_static_stub'
-              sys.exit(1)
-            frame = thread.GetFrameAtIndex(lldb_frame_index)
-            if frame.GetSymbol() and frame.GetSymbol().GetName() == 'art::mirror::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)':
-              lldb_frame_index = lldb_frame_index + 1
-              break
-        else:
-          print 'Invalid frame below compiled Java frame: ', frame
-    elif frame.GetSymbol() and frame.GetSymbol().GetName() == 'art_quick_generic_jni_trampoline':
-      # Interpreted JNI frame for x86_64
-
-      # Skip art frames
-      while True:
-        art_stack_visitor = frame.EvaluateExpression("""struct GetStackVisitor : public StackVisitor { GetStackVisitor(int depth_) : StackVisitor(Thread::Current(), NULL), depth(depth_) {} bool VisitFrame() { if (cur_depth_ == depth) { return false; } else { return true; } } int depth; }; GetStackVisitor visitor(""" + str(art_frame_index) + """); visitor.WalkStack(true); visitor""")
-        art_method = frame.EvaluateExpression(art_stack_visitor.GetName() + """.GetMethod()""")
-        if art_method.GetValueAsUnsigned() != 0:
-          # Get function/filename/lineno from ART runtime
-          art_method_name = frame.EvaluateExpression("""art::PrettyMethod(""" + art_method.GetName() + """, true)""")
-          art_method_name_data = frame.EvaluateExpression(art_method_name.GetName() + """.c_str()""").GetValueAsUnsigned()
-          art_method_name_size = frame.EvaluateExpression(art_method_name.GetName() + """.length()""").GetValueAsUnsigned()
-          error = lldb.SBError()
-          function = process.ReadCStringFromMemory(art_method_name_data, art_method_name_size + 1, error)
-
-          prettified_frames.append({
-            'function': function,
-            'file'    : None,
-            'line'    : -1
-          })
-
-          art_frame_index = art_frame_index + 1
-          break
-        art_frame_index = art_frame_index + 1
-
-      # Skip native frames
-      lldb_frame_index = lldb_frame_index + 1
-      if lldb_frame_index < thread.GetNumFrames():
-        frame = thread.GetFrameAtIndex(lldb_frame_index)
-        if frame.GetSymbol() and (frame.GetSymbol().GetName() == 'art_quick_invoke_stub' or frame.GetSymbol().GetName() == 'art_quick_invoke_static_stub'):
-          # art_quick_invoke_stub / art_quick_invoke_static_stub
-          # Skip until we get past the next ArtMethod::Invoke()
-          while True:
+            if lldb_frame_index < thread.GetNumFrames():
+                frame = thread.GetFrameAtIndex(lldb_frame_index)
+                if frame.GetModule() and re.match(
+                        r'JIT\(.*?\)', frame.GetModule().GetFileSpec().GetFilename()):
+                    # Another compile Java frame
+                    # Don't skip; leave it to the next iteration
+                    continue
+                elif frame.GetSymbol() and (frame.GetSymbol().GetName() == 'art_quick_invoke_stub' or frame.GetSymbol().GetName() == 'art_quick_invoke_static_stub'):
+                    # art_quick_invoke_stub / art_quick_invoke_static_stub
+                    # Skip until we get past the next ArtMethod::Invoke()
+                    while True:
+                        lldb_frame_index = lldb_frame_index + 1
+                        if lldb_frame_index >= thread.GetNumFrames():
+                            print 'ArtMethod::Invoke not found below art_quick_invoke_stub/art_quick_invoke_static_stub'
+                            sys.exit(1)
+                        frame = thread.GetFrameAtIndex(lldb_frame_index)
+                        if frame.GetSymbol() and frame.GetSymbol().GetName(
+                        ) == 'art::mirror::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)':
+                            lldb_frame_index = lldb_frame_index + 1
+                            break
+                else:
+                    print 'Invalid frame below compiled Java frame: ', frame
+        elif frame.GetSymbol() and frame.GetSymbol().GetName() == 'art_quick_generic_jni_trampoline':
+            # Interpreted JNI frame for x86_64
+
+            # Skip art frames
+            while True:
+                art_stack_visitor = frame.EvaluateExpression(
+                    """struct GetStackVisitor : public StackVisitor { GetStackVisitor(int depth_) : StackVisitor(Thread::Current(), NULL), depth(depth_) {} bool VisitFrame() { if (cur_depth_ == depth) { return false; } else { return true; } } int depth; }; GetStackVisitor visitor(""" +
+                    str(art_frame_index) +
+                    """); visitor.WalkStack(true); visitor""")
+                art_method = frame.EvaluateExpression(
+                    art_stack_visitor.GetName() + """.GetMethod()""")
+                if art_method.GetValueAsUnsigned() != 0:
+                    # Get function/filename/lineno from ART runtime
+                    art_method_name = frame.EvaluateExpression(
+                        """art::PrettyMethod(""" + art_method.GetName() + """, true)""")
+                    art_method_name_data = frame.EvaluateExpression(
+                        art_method_name.GetName() + """.c_str()""").GetValueAsUnsigned()
+                    art_method_name_size = frame.EvaluateExpression(
+                        art_method_name.GetName() + """.length()""").GetValueAsUnsigned()
+                    error = lldb.SBError()
+                    function = process.ReadCStringFromMemory(
+                        art_method_name_data, art_method_name_size + 1, error)
+
+                    prettified_frames.append({
+                        'function': function,
+                        'file': None,
+                        'line': -1
+                    })
+
+                    art_frame_index = art_frame_index + 1
+                    break
+                art_frame_index = art_frame_index + 1
+
+            # Skip native frames
             lldb_frame_index = lldb_frame_index + 1
-            if lldb_frame_index >= thread.GetNumFrames():
-              print 'ArtMethod::Invoke not found below art_quick_invoke_stub/art_quick_invoke_static_stub'
-              sys.exit(1)
-            frame = thread.GetFrameAtIndex(lldb_frame_index)
-            if frame.GetSymbol() and frame.GetSymbol().GetName() == 'art::mirror::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)':
-              lldb_frame_index = lldb_frame_index + 1
-              break
+            if lldb_frame_index < thread.GetNumFrames():
+                frame = thread.GetFrameAtIndex(lldb_frame_index)
+                if frame.GetSymbol() and (frame.GetSymbol().GetName() ==
+                                          'art_quick_invoke_stub' or frame.GetSymbol().GetName() == 'art_quick_invoke_static_stub'):
+                    # art_quick_invoke_stub / art_quick_invoke_static_stub
+                    # Skip until we get past the next ArtMethod::Invoke()
+                    while True:
+                        lldb_frame_index = lldb_frame_index + 1
+                        if lldb_frame_index >= thread.GetNumFrames():
+                            print 'ArtMethod::Invoke not found below art_quick_invoke_stub/art_quick_invoke_static_stub'
+                            sys.exit(1)
+                        frame = thread.GetFrameAtIndex(lldb_frame_index)
+                        if frame.GetSymbol() and frame.GetSymbol().GetName(
+                        ) == 'art::mirror::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)':
+                            lldb_frame_index = lldb_frame_index + 1
+                            break
+                else:
+                    print 'Invalid frame below compiled Java frame: ', frame
+        elif frame.GetSymbol() and re.search(r'art::interpreter::', frame.GetSymbol().GetName()):
+            # Interpreted Java frame
+
+            while True:
+                lldb_frame_index = lldb_frame_index + 1
+                if lldb_frame_index >= thread.GetNumFrames():
+                    print 'art::interpreter::Execute not found in interpreter frame'
+                    sys.exit(1)
+                frame = thread.GetFrameAtIndex(lldb_frame_index)
+                if frame.GetSymbol() and frame.GetSymbol().GetName(
+                ) == 'art::interpreter::Execute(art::Thread*, art::MethodHelper&, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue)':
+                    break
+
+            # Skip art frames
+            while True:
+                art_stack_visitor = frame.EvaluateExpression(
+                    """struct GetStackVisitor : public StackVisitor { GetStackVisitor(int depth_) : StackVisitor(Thread::Current(), NULL), depth(depth_) {} bool VisitFrame() { if (cur_depth_ == depth) { return false; } else { return true; } } int depth; }; GetStackVisitor visitor(""" +
+                    str(art_frame_index) +
+                    """); visitor.WalkStack(true); visitor""")
+                art_method = frame.EvaluateExpression(
+                    art_stack_visitor.GetName() + """.GetMethod()""")
+                if art_method.GetValueAsUnsigned() != 0:
+                    # Get function/filename/lineno from ART runtime
+                    art_method_name = frame.EvaluateExpression(
+                        """art::PrettyMethod(""" + art_method.GetName() + """, true)""")
+                    art_method_name_data = frame.EvaluateExpression(
+                        art_method_name.GetName() + """.c_str()""").GetValueAsUnsigned()
+                    art_method_name_size = frame.EvaluateExpression(
+                        art_method_name.GetName() + """.length()""").GetValueAsUnsigned()
+                    error = lldb.SBError()
+                    function = process.ReadCStringFromMemory(
+                        art_method_name_data, art_method_name_size + 1, error)
+
+                    line = frame.EvaluateExpression(
+                        art_stack_visitor.GetName() +
+                        """.GetMethod()->GetLineNumFromDexPC(""" +
+                        art_stack_visitor.GetName() +
+                        """.GetDexPc(true))""").GetValueAsUnsigned()
+
+                    file_name = frame.EvaluateExpression(
+                        art_method.GetName() + """->GetDeclaringClassSourceFile()""")
+                    file_name_data = file_name.GetValueAsUnsigned()
+                    file_name_size = frame.EvaluateExpression(
+                        """(size_t)strlen(""" + file_name.GetName() + """)""").GetValueAsUnsigned()
+                    error = lldb.SBError()
+                    file_name = process.ReadCStringFromMemory(
+                        file_name_data, file_name_size + 1, error)
+                    if not error.Success():
+                        print 'Failed to read source file name'
+                        sys.exit(1)
+
+                    prettified_frames.append({
+                        'function': function,
+                        'file': file_name,
+                        'line': line
+                    })
+
+                    art_frame_index = art_frame_index + 1
+                    break
+                art_frame_index = art_frame_index + 1
+
+            # Skip native frames
+            while True:
+                lldb_frame_index = lldb_frame_index + 1
+                if lldb_frame_index >= thread.GetNumFrames():
+                    print 'Can not get past interpreter native frames'
+                    sys.exit(1)
+                frame = thread.GetFrameAtIndex(lldb_frame_index)
+                if frame.GetSymbol() and not re.search(
+                        r'art::interpreter::', frame.GetSymbol().GetName()):
+                    break
         else:
-          print 'Invalid frame below compiled Java frame: ', frame
-    elif frame.GetSymbol() and re.search(r'art::interpreter::', frame.GetSymbol().GetName()):
-      # Interpreted Java frame
-
-      while True:
-        lldb_frame_index = lldb_frame_index + 1
-        if lldb_frame_index >= thread.GetNumFrames():
-          print 'art::interpreter::Execute not found in interpreter frame'
-          sys.exit(1)
-        frame = thread.GetFrameAtIndex(lldb_frame_index)
-        if frame.GetSymbol() and frame.GetSymbol().GetName() == 'art::interpreter::Execute(art::Thread*, art::MethodHelper&, art::DexFile::CodeItem const*, art::ShadowFrame&, art::JValue)':
-          break
+            # Other frames. Add them as-is.
+            frame = thread.GetFrameAtIndex(lldb_frame_index)
+            lldb_frame_index = lldb_frame_index + 1
+            if frame.GetModule():
+                module_name = frame.GetModule().GetFileSpec().GetFilename()
+                if not module_name in [
+                    'libartd.so',
+                    'dalvikvm32',
+                    'dalvikvm64',
+                        'libc.so.6']:
+                    prettified_frames.append({
+                        'function': frame.GetSymbol().GetName() if frame.GetSymbol() else None,
+                        'file': str(frame.GetLineEntry().GetFileSpec()) if frame.GetLineEntry() else None,
+                        'line': frame.GetLineEntry().GetLine() if frame.GetLineEntry() else -1
+                    })
 
-      # Skip art frames
-      while True:
-        art_stack_visitor = frame.EvaluateExpression("""struct GetStackVisitor : public StackVisitor { GetStackVisitor(int depth_) : StackVisitor(Thread::Current(), NULL), depth(depth_) {} bool VisitFrame() { if (cur_depth_ == depth) { return false; } else { return true; } } int depth; }; GetStackVisitor visitor(""" + str(art_frame_index) + """); visitor.WalkStack(true); visitor""")
-        art_method = frame.EvaluateExpression(art_stack_visitor.GetName() + """.GetMethod()""")
-        if art_method.GetValueAsUnsigned() != 0:
-          # Get function/filename/lineno from ART runtime
-          art_method_name = frame.EvaluateExpression("""art::PrettyMethod(""" + art_method.GetName() + """, true)""")
-          art_method_name_data = frame.EvaluateExpression(art_method_name.GetName() + """.c_str()""").GetValueAsUnsigned()
-          art_method_name_size = frame.EvaluateExpression(art_method_name.GetName() + """.length()""").GetValueAsUnsigned()
-          error = lldb.SBError()
-          function = process.ReadCStringFromMemory(art_method_name_data, art_method_name_size + 1, error)
-
-          line = frame.EvaluateExpression(art_stack_visitor.GetName() + """.GetMethod()->GetLineNumFromDexPC(""" + art_stack_visitor.GetName() + """.GetDexPc(true))""").GetValueAsUnsigned()
-          
-          file_name = frame.EvaluateExpression(art_method.GetName() + """->GetDeclaringClassSourceFile()""")
-          file_name_data = file_name.GetValueAsUnsigned()
-          file_name_size = frame.EvaluateExpression("""(size_t)strlen(""" + file_name.GetName() + """)""").GetValueAsUnsigned()
-          error = lldb.SBError()
-          file_name = process.ReadCStringFromMemory(file_name_data, file_name_size + 1, error)
-          if not error.Success():
-            print 'Failed to read source file name'
-            sys.exit(1)
-
-          prettified_frames.append({
-            'function': function,
-            'file'    : file_name,
-            'line'    : line
-          })
-
-          art_frame_index = art_frame_index + 1
-          break
-        art_frame_index = art_frame_index + 1
-
-      # Skip native frames
-      while True:
-        lldb_frame_index = lldb_frame_index + 1
-        if lldb_frame_index >= thread.GetNumFrames():
-          print 'Can not get past interpreter native frames'
-          sys.exit(1)
-        frame = thread.GetFrameAtIndex(lldb_frame_index)
-        if frame.GetSymbol() and not re.search(r'art::interpreter::', frame.GetSymbol().GetName()):
-          break
-    else:
-      # Other frames. Add them as-is.
-      frame = thread.GetFrameAtIndex(lldb_frame_index)
-      lldb_frame_index = lldb_frame_index + 1
-      if frame.GetModule():
-        module_name = frame.GetModule().GetFileSpec().GetFilename()
-        if not module_name in ['libartd.so', 'dalvikvm32', 'dalvikvm64', 'libc.so.6']:
-          prettified_frames.append({
-            'function': frame.GetSymbol().GetName() if frame.GetSymbol() else None,
-            'file'    : str(frame.GetLineEntry().GetFileSpec()) if frame.GetLineEntry() else None,
-            'line'    : frame.GetLineEntry().GetLine() if frame.GetLineEntry() else -1
-          })
+    for prettified_frame in prettified_frames:
+        print prettified_frame['function'], prettified_frame['file'], prettified_frame['line']
 
-  for prettified_frame in prettified_frames:
-    print prettified_frame['function'], prettified_frame['file'], prettified_frame['line']
 
 def __lldb_init_module(debugger, internal_dict):
-    debugger.HandleCommand('command script add -f host_art_bt.host_art_bt host_art_bt')
+    debugger.HandleCommand(
+        'command script add -f host_art_bt.host_art_bt host_art_bt')

Modified: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/finishSwigPythonLLDB.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/finishSwigPythonLLDB.py (original)
+++ lldb/trunk/scripts/Python/finishSwigPythonLLDB.py Tue Sep  6 15:57:50 2016
@@ -73,6 +73,7 @@ strErrMsgUnexpected = "Unexpected error:
 strMsgCopySixPy = "Copying six.py from '%s' to '%s'"
 strErrMsgCopySixPyFailed = "Unable to copy '%s' to '%s'"
 
+
 def is_debug_interpreter():
     return hasattr(sys, 'gettotalrefcount')
 
@@ -84,8 +85,11 @@ def is_debug_interpreter():
 #           Str - Error description on task failure.
 # Throws:   None.
 #--
+
+
 def macosx_copy_file_for_heap(vDictArgs, vstrFrameworkPythonDir):
-    dbg = utilsDebug.CDebugFnVerbose("Python script macosx_copy_file_for_heap()")
+    dbg = utilsDebug.CDebugFnVerbose(
+        "Python script macosx_copy_file_for_heap()")
     bOk = True
     strMsg = ""
 
@@ -101,9 +105,21 @@ def macosx_copy_file_for_heap(vDictArgs,
     os.makedirs(strHeapDir)
 
     strRoot = os.path.normpath(vDictArgs["--srcRoot"])
-    strSrc = os.path.join(strRoot, "examples", "darwin", "heap_find", "heap", "heap_find.cpp")
+    strSrc = os.path.join(
+        strRoot,
+        "examples",
+        "darwin",
+        "heap_find",
+        "heap",
+        "heap_find.cpp")
     shutil.copy(strSrc, strHeapDir)
-    strSrc = os.path.join(strRoot, "examples", "darwin", "heap_find", "heap", "Makefile")
+    strSrc = os.path.join(
+        strRoot,
+        "examples",
+        "darwin",
+        "heap_find",
+        "heap",
+        "Makefile")
     shutil.copy(strSrc, strHeapDir)
 
     return (bOk, strMsg)
@@ -118,7 +134,13 @@ def macosx_copy_file_for_heap(vDictArgs,
 #           Str - Error description on task failure.
 # Throws:   None.
 #--
-def create_py_pkg(vDictArgs, vstrFrameworkPythonDir, vstrPkgDir, vListPkgFiles):
+
+
+def create_py_pkg(
+        vDictArgs,
+        vstrFrameworkPythonDir,
+        vstrPkgDir,
+        vListPkgFiles):
     dbg = utilsDebug.CDebugFnVerbose("Python script create_py_pkg()")
     dbg.dump_object("Package file(s):", vListPkgFiles)
     bDbg = "-d" in vDictArgs
@@ -161,7 +183,7 @@ def create_py_pkg(vDictArgs, vstrFramewo
             strBaseName = os.path.basename(strPkgFile)
             nPos = strBaseName.find(".")
             if nPos != -1:
-                strBaseName = strBaseName[0 : nPos]
+                strBaseName = strBaseName[0: nPos]
             strPyScript += "%s\"%s\"" % (strDelimiter, strBaseName)
             strDelimiter = ","
     strPyScript += "]\n"
@@ -186,8 +208,14 @@ def create_py_pkg(vDictArgs, vstrFramewo
 #           Str - Error description on task failure.
 # Throws:   None.
 #--
-def copy_lldbpy_file_to_lldb_pkg_dir(vDictArgs, vstrFrameworkPythonDir, vstrCfgBldDir):
-    dbg = utilsDebug.CDebugFnVerbose("Python script copy_lldbpy_file_to_lldb_pkg_dir()")
+
+
+def copy_lldbpy_file_to_lldb_pkg_dir(
+        vDictArgs,
+        vstrFrameworkPythonDir,
+        vstrCfgBldDir):
+    dbg = utilsDebug.CDebugFnVerbose(
+        "Python script copy_lldbpy_file_to_lldb_pkg_dir()")
     bOk = True
     bDbg = "-d" in vDictArgs
     strMsg = ""
@@ -207,7 +235,8 @@ def copy_lldbpy_file_to_lldb_pkg_dir(vDi
         shutil.copyfile(strSrc, strDst)
     except IOError as e:
         bOk = False
-        strMsg = "I/O error(%d): %s %s" % (e.errno, e.strerror, strErrMsgCpLldbpy)
+        strMsg = "I/O error(%d): %s %s" % (e.errno,
+                                           e.strerror, strErrMsgCpLldbpy)
         if e.errno == 2:
             strMsg += " Src:'%s' Dst:'%s'" % (strSrc, strDst)
     except:
@@ -224,6 +253,8 @@ def copy_lldbpy_file_to_lldb_pkg_dir(vDi
 #           Str - Error description on task failure.
 # Throws:   None.
 #--
+
+
 def make_symlink_windows(vstrSrcPath, vstrTargetPath):
     print(("Making symlink from %s to %s" % (vstrSrcPath, vstrTargetPath)))
     dbg = utilsDebug.CDebugFnVerbose("Python script make_symlink_windows()")
@@ -238,13 +269,16 @@ def make_symlink_windows(vstrSrcPath, vs
         # re-create the link.  This can happen if you run this script once (creating a link)
         # and then delete the source file (so that a brand new file gets created the next time
         # you compile and link), and then re-run this script, so that both the target hardlink
-        # and the source file exist, but the target refers to an old copy of the source.
-        if (target_stat.st_ino == src_stat.st_ino) and (target_stat.st_dev == src_stat.st_dev):
+        # and the source file exist, but the target refers to an old copy of
+        # the source.
+        if (target_stat.st_ino == src_stat.st_ino) and (
+                target_stat.st_dev == src_stat.st_dev):
             return (bOk, strErrMsg)
 
         os.remove(vstrTargetPath)
     except:
-        # If the target file don't exist, ignore this exception, we will link it shortly.
+        # If the target file don't exist, ignore this exception, we will link
+        # it shortly.
         pass
 
     try:
@@ -256,8 +290,10 @@ def make_symlink_windows(vstrSrcPath, vs
     except Exception as e:
         if e.errno != 17:
             bOk = False
-            strErrMsg = "WinError(%d): %s %s" % (e.errno, e.strerror, strErrMsgMakeSymlink)
-            strErrMsg += " Src:'%s' Target:'%s'" % (vstrSrcPath, vstrTargetPath)
+            strErrMsg = "WinError(%d): %s %s" % (
+                e.errno, e.strerror, strErrMsgMakeSymlink)
+            strErrMsg += " Src:'%s' Target:'%s'" % (
+                vstrSrcPath, vstrTargetPath)
 
     return (bOk, strErrMsg)
 
@@ -269,8 +305,11 @@ def make_symlink_windows(vstrSrcPath, vs
 #           Str - Error description on task failure.
 # Throws:   None.
 #--
+
+
 def make_symlink_other_platforms(vstrSrcPath, vstrTargetPath):
-    dbg = utilsDebug.CDebugFnVerbose("Python script make_symlink_other_platforms()")
+    dbg = utilsDebug.CDebugFnVerbose(
+        "Python script make_symlink_other_platforms()")
     bOk = True
     strErrMsg = ""
 
@@ -278,7 +317,8 @@ def make_symlink_other_platforms(vstrSrc
         os.symlink(vstrSrcPath, vstrTargetPath)
     except OSError as e:
         bOk = False
-        strErrMsg = "OSError(%d): %s %s" % (e.errno, e.strerror, strErrMsgMakeSymlink)
+        strErrMsg = "OSError(%d): %s %s" % (
+            e.errno, e.strerror, strErrMsgMakeSymlink)
         strErrMsg += " Src:'%s' Target:'%s'" % (vstrSrcPath, vstrTargetPath)
     except:
         bOk = False
@@ -286,6 +326,7 @@ def make_symlink_other_platforms(vstrSrc
 
     return (bOk, strErrMsg)
 
+
 def make_symlink_native(vDictArgs, strSrc, strTarget):
     eOSType = utilsOsType.determine_os_type()
     bDbg = "-d" in vDictArgs
@@ -323,7 +364,13 @@ def make_symlink_native(vDictArgs, strSr
 #           Str - Error description on task failure.
 # Throws:   None.
 #--
-def make_symlink(vDictArgs, vstrFrameworkPythonDir, vstrSrcFile, vstrTargetFile):
+
+
+def make_symlink(
+        vDictArgs,
+        vstrFrameworkPythonDir,
+        vstrSrcFile,
+        vstrTargetFile):
     dbg = utilsDebug.CDebugFnVerbose("Python script make_symlink()")
     bOk = True
     strErrMsg = ""
@@ -363,7 +410,11 @@ def make_symlink(vDictArgs, vstrFramewor
 #           Str - Error description on task failure.
 # Throws:   None.
 #--
-def make_symlink_liblldb(vDictArgs, vstrFrameworkPythonDir, vstrLiblldbFileName, vstrLldbLibDir):
+def make_symlink_liblldb(
+        vDictArgs,
+        vstrFrameworkPythonDir,
+        vstrLiblldbFileName,
+        vstrLldbLibDir):
     dbg = utilsDebug.CDebugFnVerbose("Python script make_symlink_liblldb()")
     bOk = True
     strErrMsg = ""
@@ -395,7 +446,8 @@ def make_symlink_liblldb(vDictArgs, vstr
                 strLibFileExtn = ".so"
             strSrc = os.path.join(vstrLldbLibDir, "liblldb" + strLibFileExtn)
 
-    bOk, strErrMsg = make_symlink(vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget)
+    bOk, strErrMsg = make_symlink(
+        vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget)
 
     return (bOk, strErrMsg)
 
@@ -408,8 +460,14 @@ def make_symlink_liblldb(vDictArgs, vstr
 #           Str - Error description on task failure.
 # Throws:   None.
 #--
-def make_symlink_darwin_debug(vDictArgs, vstrFrameworkPythonDir, vstrDarwinDebugFileName):
-    dbg = utilsDebug.CDebugFnVerbose("Python script make_symlink_darwin_debug()")
+
+
+def make_symlink_darwin_debug(
+        vDictArgs,
+        vstrFrameworkPythonDir,
+        vstrDarwinDebugFileName):
+    dbg = utilsDebug.CDebugFnVerbose(
+        "Python script make_symlink_darwin_debug()")
     bOk = True
     strErrMsg = ""
     strTarget = vstrDarwinDebugFileName
@@ -421,7 +479,8 @@ def make_symlink_darwin_debug(vDictArgs,
     else:
         strSrc = os.path.join("bin", "lldb-launcher")
 
-    bOk, strErrMsg = make_symlink(vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget)
+    bOk, strErrMsg = make_symlink(
+        vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget)
 
     return (bOk, strErrMsg)
 
@@ -434,8 +493,14 @@ def make_symlink_darwin_debug(vDictArgs,
 #           Str - Error description on task failure.
 # Throws:   None.
 #--
-def make_symlink_lldb_argdumper(vDictArgs, vstrFrameworkPythonDir, vstrArgdumperFileName):
-    dbg = utilsDebug.CDebugFnVerbose("Python script make_symlink_lldb_argdumper()")
+
+
+def make_symlink_lldb_argdumper(
+        vDictArgs,
+        vstrFrameworkPythonDir,
+        vstrArgdumperFileName):
+    dbg = utilsDebug.CDebugFnVerbose(
+        "Python script make_symlink_lldb_argdumper()")
     bOk = True
     strErrMsg = ""
     strTarget = vstrArgdumperFileName
@@ -454,7 +519,8 @@ def make_symlink_lldb_argdumper(vDictArg
             strExeFileExtn = ".exe"
         strSrc = os.path.join("bin", "lldb-argdumper" + strExeFileExtn)
 
-    bOk, strErrMsg = make_symlink(vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget)
+    bOk, strErrMsg = make_symlink(
+        vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget)
 
     return (bOk, strErrMsg)
 
@@ -468,6 +534,8 @@ def make_symlink_lldb_argdumper(vDictArg
 #           strErrMsg - Error description on task failure.
 # Throws:   None.
 #--
+
+
 def create_symlinks(vDictArgs, vstrFrameworkPythonDir, vstrLldbLibDir):
     dbg = utilsDebug.CDebugFnVerbose("Python script create_symlinks()")
     bOk = True
@@ -498,6 +566,7 @@ def create_symlinks(vDictArgs, vstrFrame
 
     return (bOk, strErrMsg)
 
+
 def copy_six(vDictArgs, vstrFrameworkPythonDir):
     dbg = utilsDebug.CDebugFnVerbose("Python script copy_six()")
     bDbg = "-d" in vDictArgs
@@ -505,7 +574,13 @@ def copy_six(vDictArgs, vstrFrameworkPyt
     strMsg = ""
     site_packages_dir = os.path.dirname(vstrFrameworkPythonDir)
     six_module_filename = "six.py"
-    src_file = os.path.join(vDictArgs['--srcRoot'], "third_party", "Python", "module", "six", six_module_filename)
+    src_file = os.path.join(
+        vDictArgs['--srcRoot'],
+        "third_party",
+        "Python",
+        "module",
+        "six",
+        six_module_filename)
     src_file = os.path.normpath(src_file)
     target = os.path.join(site_packages_dir, six_module_filename)
 
@@ -528,8 +603,11 @@ def copy_six(vDictArgs, vstrFrameworkPyt
 #           Str - Error description on task failure.
 # Throws:   None.
 #--
+
+
 def find_or_create_python_dir(vDictArgs, vstrFrameworkPythonDir):
-    dbg = utilsDebug.CDebugFnVerbose("Python script find_or_create_python_dir()")
+    dbg = utilsDebug.CDebugFnVerbose(
+        "Python script find_or_create_python_dir()")
     bOk = True
     strMsg = ""
     bDbg = "-d" in vDictArgs
@@ -546,8 +624,8 @@ def find_or_create_python_dir(vDictArgs,
         os.makedirs(vstrFrameworkPythonDir)
     except OSError as exception:
         bOk = False
-        strMsg = strErrMsgCreateFrmWkPyDirFailed % (vstrFrameworkPythonDir,
-                                                    os.strerror(exception.errno))
+        strMsg = strErrMsgCreateFrmWkPyDirFailed % (
+            vstrFrameworkPythonDir, os.strerror(exception.errno))
 
     return (bOk, strMsg)
 
@@ -561,6 +639,8 @@ def find_or_create_python_dir(vDictArgs,
 #           strErrMsg - Error description on task failure.
 # Throws:   None.
 #--
+
+
 def get_config_build_dir(vDictArgs, vstrFrameworkPythonDir):
     dbg = utilsDebug.CDebugFnVerbose("Python script get_config_build_dir()")
     bOk = True
@@ -584,8 +664,11 @@ def get_config_build_dir(vDictArgs, vstr
 #           strErrMsg - Error description on task failure.
 # Throws:   None.
 #--
+
+
 def get_framework_python_dir_windows(vDictArgs):
-    dbg = utilsDebug.CDebugFnVerbose("Python script get_framework_python_dir_windows()")
+    dbg = utilsDebug.CDebugFnVerbose(
+        "Python script get_framework_python_dir_windows()")
     bOk = True
     strWkDir = ""
     strErrMsg = ""
@@ -601,7 +684,9 @@ def get_framework_python_dir_windows(vDi
 
     bHaveArgCmakeBuildConfiguration = "--cmakeBuildConfiguration" in vDictArgs
     if bHaveArgCmakeBuildConfiguration:
-        strPythonInstallDir = os.path.join(strPythonInstallDir, vDictArgs["--cmakeBuildConfiguration"])
+        strPythonInstallDir = os.path.join(
+            strPythonInstallDir,
+            vDictArgs["--cmakeBuildConfiguration"])
 
     if strPythonInstallDir.__len__() != 0:
         strWkDir = get_python_lib(True, False, strPythonInstallDir)
@@ -620,8 +705,11 @@ def get_framework_python_dir_windows(vDi
 #           strErrMsg - Error description on task failure.
 # Throws:   None.
 #--
+
+
 def get_framework_python_dir_other_platforms(vDictArgs):
-    dbg = utilsDebug.CDebugFnVerbose("Python script get_framework_python_dir_other_platform()")
+    dbg = utilsDebug.CDebugFnVerbose(
+        "Python script get_framework_python_dir_other_platform()")
     bOk = True
     strWkDir = ""
     strErrMsg = ""
@@ -658,8 +746,11 @@ def get_framework_python_dir_other_platf
 #           strErrMsg - Error description on task failure.
 # Throws:   None.
 #--
+
+
 def get_framework_python_dir(vDictArgs):
-    dbg = utilsDebug.CDebugFnVerbose("Python script get_framework_python_dir()")
+    dbg = utilsDebug.CDebugFnVerbose(
+        "Python script get_framework_python_dir()")
     bOk = True
     strWkDir = ""
     strErrMsg = ""
@@ -671,7 +762,8 @@ def get_framework_python_dir(vDictArgs):
     elif eOSType == utilsOsType.EnumOsType.Windows:
         bOk, strWkDir, strErrMsg = get_framework_python_dir_windows(vDictArgs)
     else:
-        bOk, strWkDir, strErrMsg = get_framework_python_dir_other_platforms(vDictArgs)
+        bOk, strWkDir, strErrMsg = get_framework_python_dir_other_platforms(
+            vDictArgs)
 
     return (bOk, strWkDir, strErrMsg)
 
@@ -683,6 +775,8 @@ def get_framework_python_dir(vDictArgs):
 #           strErrMsg - Error description on task failure.
 # Throws:   None.
 #--
+
+
 def get_liblldb_dir(vDictArgs):
     dbg = utilsDebug.CDebugFnVerbose("Python script get_liblldb_dir()")
     bOk = True
@@ -731,6 +825,8 @@ def get_liblldb_dir(vDictArgs):
     --------------------------------------------------------------------------
 
 """
+
+
 def main(vDictArgs):
     dbg = utilsDebug.CDebugFnVerbose("Python script main()")
     bOk = True
@@ -748,7 +844,8 @@ def main(vDictArgs):
     bOk, strFrameworkPythonDir, strMsg = get_framework_python_dir(vDictArgs)
 
     if bOk:
-        bOk, strCfgBldDir, strMsg = get_config_build_dir(vDictArgs, strFrameworkPythonDir)
+        bOk, strCfgBldDir, strMsg = get_config_build_dir(
+            vDictArgs, strFrameworkPythonDir)
     if bOk and bDbg:
         print((strMsgPyFileLocatedHere % strFrameworkPythonDir))
         print((strMsgConfigBuildDir % strCfgBldDir))
@@ -757,10 +854,12 @@ def main(vDictArgs):
         bOk, strLldbLibDir, strMsg = get_liblldb_dir(vDictArgs)
 
     if bOk:
-        bOk, strMsg = find_or_create_python_dir(vDictArgs, strFrameworkPythonDir)
+        bOk, strMsg = find_or_create_python_dir(
+            vDictArgs, strFrameworkPythonDir)
 
     if bOk:
-        bOk, strMsg = create_symlinks(vDictArgs, strFrameworkPythonDir, strLldbLibDir)
+        bOk, strMsg = create_symlinks(
+            vDictArgs, strFrameworkPythonDir, strLldbLibDir)
 
     if bOk:
         bOk, strMsg = copy_six(vDictArgs, strFrameworkPythonDir)
@@ -772,52 +871,100 @@ def main(vDictArgs):
     strRoot = os.path.normpath(vDictArgs["--srcRoot"])
     if bOk:
         # lldb
-        listPkgFiles = [os.path.join(strRoot, "source", "Interpreter", "embedded_interpreter.py")]
-        bOk, strMsg = create_py_pkg(vDictArgs, strFrameworkPythonDir, "", listPkgFiles)
+        listPkgFiles = [
+            os.path.join(
+                strRoot,
+                "source",
+                "Interpreter",
+                "embedded_interpreter.py")]
+        bOk, strMsg = create_py_pkg(
+            vDictArgs, strFrameworkPythonDir, "", listPkgFiles)
 
     if bOk:
         # lldb/formatters/cpp
-        listPkgFiles = [os.path.join(strRoot, "examples", "synthetic", "gnu_libstdcpp.py"),
-                        os.path.join(strRoot, "examples", "synthetic", "libcxx.py")]
-        bOk, strMsg = create_py_pkg(vDictArgs, strFrameworkPythonDir, "/formatters/cpp", listPkgFiles)
+        listPkgFiles = [
+            os.path.join(
+                strRoot,
+                "examples",
+                "synthetic",
+                "gnu_libstdcpp.py"),
+            os.path.join(
+                strRoot,
+                "examples",
+                "synthetic",
+                "libcxx.py")]
+        bOk, strMsg = create_py_pkg(
+            vDictArgs, strFrameworkPythonDir, "/formatters/cpp", listPkgFiles)
 
     if bOk:
         # Make an empty __init__.py in lldb/runtime as this is required for
         # Python to recognize lldb.runtime as a valid package (and hence,
         # lldb.runtime.objc as a valid contained package)
         listPkgFiles = []
-        bOk, strMsg = create_py_pkg(vDictArgs, strFrameworkPythonDir, "/runtime", listPkgFiles)
+        bOk, strMsg = create_py_pkg(
+            vDictArgs, strFrameworkPythonDir, "/runtime", listPkgFiles)
 
     if bOk:
         # lldb/formatters
         # Having these files copied here ensure that lldb/formatters is a
         # valid package itself
-        listPkgFiles = [os.path.join(strRoot, "examples", "summaries", "cocoa", "cache.py"),
-                        os.path.join(strRoot, "examples", "summaries", "synth.py"),
-                        os.path.join(strRoot, "examples", "summaries", "cocoa", "metrics.py"),
-                        os.path.join(strRoot, "examples", "summaries", "cocoa", "attrib_fromdict.py"),
-                        os.path.join(strRoot, "examples", "summaries", "cocoa", "Logger.py")]
-        bOk, strMsg = create_py_pkg(vDictArgs, strFrameworkPythonDir, "/formatters", listPkgFiles)
+        listPkgFiles = [
+            os.path.join(
+                strRoot, "examples", "summaries", "cocoa", "cache.py"), os.path.join(
+                strRoot, "examples", "summaries", "synth.py"), os.path.join(
+                strRoot, "examples", "summaries", "cocoa", "metrics.py"), os.path.join(
+                    strRoot, "examples", "summaries", "cocoa", "attrib_fromdict.py"), os.path.join(
+                        strRoot, "examples", "summaries", "cocoa", "Logger.py")]
+        bOk, strMsg = create_py_pkg(
+            vDictArgs, strFrameworkPythonDir, "/formatters", listPkgFiles)
 
     if bOk:
         # lldb/utils
-        listPkgFiles = [os.path.join(strRoot, "examples", "python", "symbolication.py")]
-        bOk, strMsg = create_py_pkg(vDictArgs, strFrameworkPythonDir, "/utils", listPkgFiles)
+        listPkgFiles = [
+            os.path.join(
+                strRoot,
+                "examples",
+                "python",
+                "symbolication.py")]
+        bOk, strMsg = create_py_pkg(
+            vDictArgs, strFrameworkPythonDir, "/utils", listPkgFiles)
 
     if bOk and (eOSType == utilsOsType.EnumOsType.Darwin):
         # lldb/macosx
-        listPkgFiles = [os.path.join(strRoot, "examples", "python", "crashlog.py"),
-                        os.path.join(strRoot, "examples", "darwin", "heap_find", "heap.py")]
-        bOk, strMsg = create_py_pkg(vDictArgs, strFrameworkPythonDir, "/macosx", listPkgFiles)
+        listPkgFiles = [
+            os.path.join(
+                strRoot,
+                "examples",
+                "python",
+                "crashlog.py"),
+            os.path.join(
+                strRoot,
+                "examples",
+                "darwin",
+                "heap_find",
+                "heap.py")]
+        bOk, strMsg = create_py_pkg(
+            vDictArgs, strFrameworkPythonDir, "/macosx", listPkgFiles)
 
     if bOk and (eOSType == utilsOsType.EnumOsType.Darwin):
         # lldb/diagnose
-        listPkgFiles = [os.path.join(strRoot, "examples", "python", "diagnose_unwind.py"),
-                        os.path.join(strRoot, "examples", "python", "diagnose_nsstring.py")]
-        bOk, strMsg = create_py_pkg(vDictArgs, strFrameworkPythonDir, "/diagnose", listPkgFiles)
+        listPkgFiles = [
+            os.path.join(
+                strRoot,
+                "examples",
+                "python",
+                "diagnose_unwind.py"),
+            os.path.join(
+                strRoot,
+                "examples",
+                "python",
+                "diagnose_nsstring.py")]
+        bOk, strMsg = create_py_pkg(
+            vDictArgs, strFrameworkPythonDir, "/diagnose", listPkgFiles)
 
     if bOk:
-        bOk, strMsg = macosx_copy_file_for_heap(vDictArgs, strFrameworkPythonDir)
+        bOk, strMsg = macosx_copy_file_for_heap(
+            vDictArgs, strFrameworkPythonDir)
 
     if bOk:
         return (0, strMsg)
@@ -834,4 +981,3 @@ def main(vDictArgs):
 # function directly
 if __name__ == "__main__":
     print("Script cannot be called directly, called by finishSwigWrapperClasses.py")
-

Modified: lldb/trunk/scripts/Python/modify-python-lldb.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/modify-python-lldb.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/modify-python-lldb.py (original)
+++ lldb/trunk/scripts/Python/modify-python-lldb.py Tue Sep  6 15:57:50 2016
@@ -22,7 +22,8 @@
 #
 
 # System modules
-import sys, re
+import sys
+import re
 if sys.version_info.major >= 3:
     import io as StringIO
 else:
@@ -45,7 +46,7 @@ else:
 
 #
 # Version string
-# 
+#
 version_line = "swig_version = %s"
 
 #
@@ -60,6 +61,7 @@ doxygen_comment_start = re.compile("^\s*
 # When bracketed by the lines, the CLEANUP_DOCSTRING state (see below) is ON.
 toggle_docstring_cleanup_line = '        """'
 
+
 def char_to_str_xform(line):
     """This transforms the 'char', i.e, 'char *' to 'str', Python string."""
     line = line.replace(' char', ' str')
@@ -74,7 +76,9 @@ def char_to_str_xform(line):
 #
 TWO_SPACES = ' ' * 2
 EIGHT_SPACES = ' ' * 8
-one_liner_docstring_pattern = re.compile('^(%s|%s)""".*"""$' % (TWO_SPACES, EIGHT_SPACES))
+one_liner_docstring_pattern = re.compile(
+    '^(%s|%s)""".*"""$' %
+    (TWO_SPACES, EIGHT_SPACES))
 
 #
 # lldb_helpers and lldb_iter() should appear before our first SB* class definition.
@@ -226,47 +230,48 @@ symbol_in_section_iter_def = '''
 #
 # This dictionary defines a mapping from classname to (getsize, getelem) tuple.
 #
-d = { 'SBBreakpoint':  ('GetNumLocations',   'GetLocationAtIndex'),
-      'SBCompileUnit': ('GetNumLineEntries', 'GetLineEntryAtIndex'),
-      'SBDebugger':    ('GetNumTargets',     'GetTargetAtIndex'),
-      'SBModule':      ('GetNumSymbols',     'GetSymbolAtIndex'),
-      'SBProcess':     ('GetNumThreads',     'GetThreadAtIndex'),
-      'SBSection':     ('GetNumSubSections', 'GetSubSectionAtIndex'),
-      'SBThread':      ('GetNumFrames',      'GetFrameAtIndex'),
-
-      'SBInstructionList':   ('GetSize', 'GetInstructionAtIndex'),
-      'SBStringList':        ('GetSize', 'GetStringAtIndex',),
-      'SBSymbolContextList': ('GetSize', 'GetContextAtIndex'),
-      'SBTypeList':          ('GetSize', 'GetTypeAtIndex'),
-      'SBValueList':         ('GetSize', 'GetValueAtIndex'),
-
-      'SBType':  ('GetNumberChildren', 'GetChildAtIndex'),
-      'SBValue': ('GetNumChildren',    'GetChildAtIndex'),
-
-      # SBTarget needs special processing, see below.
-      'SBTarget': {'module':     ('GetNumModules', 'GetModuleAtIndex'),
-                   'breakpoint': ('GetNumBreakpoints', 'GetBreakpointAtIndex'),
-                   'watchpoint': ('GetNumWatchpoints', 'GetWatchpointAtIndex')
-                   },
-
-      # SBModule has an additional section_iter(), see below.
-      'SBModule-section': ('GetNumSections', 'GetSectionAtIndex'),
-      # And compile_unit_iter().
-      'SBModule-compile-unit': ('GetNumCompileUnits', 'GetCompileUnitAtIndex'),
-      # As well as symbol_in_section_iter().
-      'SBModule-symbol-in-section': symbol_in_section_iter_def
-      }
+d = {'SBBreakpoint': ('GetNumLocations', 'GetLocationAtIndex'),
+     'SBCompileUnit': ('GetNumLineEntries', 'GetLineEntryAtIndex'),
+     'SBDebugger': ('GetNumTargets', 'GetTargetAtIndex'),
+     'SBModule': ('GetNumSymbols', 'GetSymbolAtIndex'),
+     'SBProcess': ('GetNumThreads', 'GetThreadAtIndex'),
+     'SBSection': ('GetNumSubSections', 'GetSubSectionAtIndex'),
+     'SBThread': ('GetNumFrames', 'GetFrameAtIndex'),
+
+     'SBInstructionList': ('GetSize', 'GetInstructionAtIndex'),
+     'SBStringList': ('GetSize', 'GetStringAtIndex',),
+     'SBSymbolContextList': ('GetSize', 'GetContextAtIndex'),
+     'SBTypeList': ('GetSize', 'GetTypeAtIndex'),
+     'SBValueList': ('GetSize', 'GetValueAtIndex'),
+
+     'SBType': ('GetNumberChildren', 'GetChildAtIndex'),
+     'SBValue': ('GetNumChildren', 'GetChildAtIndex'),
+
+     # SBTarget needs special processing, see below.
+     'SBTarget': {'module': ('GetNumModules', 'GetModuleAtIndex'),
+                  'breakpoint': ('GetNumBreakpoints', 'GetBreakpointAtIndex'),
+                  'watchpoint': ('GetNumWatchpoints', 'GetWatchpointAtIndex')
+                  },
+
+     # SBModule has an additional section_iter(), see below.
+     'SBModule-section': ('GetNumSections', 'GetSectionAtIndex'),
+     # And compile_unit_iter().
+     'SBModule-compile-unit': ('GetNumCompileUnits', 'GetCompileUnitAtIndex'),
+     # As well as symbol_in_section_iter().
+     'SBModule-symbol-in-section': symbol_in_section_iter_def
+     }
 
 #
 # This dictionary defines a mapping from classname to equality method name(s).
 #
-e = { 'SBAddress':            ['GetFileAddress', 'GetModule'],
-      'SBBreakpoint':         ['GetID'],
-      'SBWatchpoint':         ['GetID'],
-      'SBFileSpec':           ['GetFilename', 'GetDirectory'],
-      'SBModule':             ['GetFileSpec', 'GetUUIDString'],
-      'SBType':               ['GetByteSize', 'GetName']
-      }
+e = {'SBAddress': ['GetFileAddress', 'GetModule'],
+     'SBBreakpoint': ['GetID'],
+     'SBWatchpoint': ['GetID'],
+     'SBFileSpec': ['GetFilename', 'GetDirectory'],
+     'SBModule': ['GetFileSpec', 'GetUUIDString'],
+     'SBType': ['GetByteSize', 'GetName']
+     }
+
 
 def list_to_frag(list):
     """Transform a list to equality program fragment.
@@ -284,30 +289,37 @@ def list_to_frag(list):
         frag.write("self.{0}() == other.{0}()".format(list[i]))
     return frag.getvalue()
 
+
 class NewContent(StringIO.StringIO):
     """Simple facade to keep track of the previous line to be committed."""
+
     def __init__(self):
         StringIO.StringIO.__init__(self)
         self.prev_line = None
+
     def add_line(self, a_line):
         """Add a line to the content, if there is a previous line, commit it."""
-        if self.prev_line != None:
+        if self.prev_line is not None:
             self.write(self.prev_line + "\n")
         self.prev_line = a_line
+
     def del_line(self):
         """Forget about the previous line, do not commit it."""
         self.prev_line = None
+
     def del_blank_line(self):
         """Forget about the previous line if it is a blank line."""
-        if self.prev_line != None and not self.prev_line.strip():
+        if self.prev_line is not None and not self.prev_line.strip():
             self.prev_line = None
+
     def finish(self):
         """Call this when you're finished with populating content."""
-        if self.prev_line != None:
+        if self.prev_line is not None:
             self.write(self.prev_line + "\n")
         self.prev_line = None
 
-# The new content will have the iteration protocol defined for our lldb objects.
+# The new content will have the iteration protocol defined for our lldb
+# objects.
 new_content = NewContent()
 
 with open(output_name, 'r') as f_in:
@@ -333,7 +345,7 @@ DEFINING_EQUALITY = 4
 CLEANUP_DOCSTRING = 8
 
 # The lldb_iter_def only needs to be inserted once.
-lldb_iter_defined = False;
+lldb_iter_defined = False
 
 # Our FSM begins its life in the NORMAL state, and transitions to the
 # DEFINING_ITERATOR and/or DEFINING_EQUALITY state whenever it encounters the
@@ -361,7 +373,7 @@ for line in content.splitlines():
     #
     # If '        """' is the sole line, prepare to transition to the
     # CLEANUP_DOCSTRING state or out of it.
-    
+
     if line == toggle_docstring_cleanup_line:
         if state & CLEANUP_DOCSTRING:
             # Special handling of the trailing blank line right before the '"""'
@@ -379,7 +391,8 @@ for line in content.splitlines():
                 v = match.group(1)
                 swig_version_tuple = tuple(map(int, (v.split("."))))
         elif not line.startswith('#'):
-            # This is the first non-comment line after the header.  Inject the version
+            # This is the first non-comment line after the header.  Inject the
+            # version
             new_line = version_line % str(swig_version_tuple)
             new_content.add_line(new_line)
             state = NORMAL
@@ -424,11 +437,13 @@ for line in content.splitlines():
                     new_content.add_line(eq_def % (cls, list_to_frag(e[cls])))
                     new_content.add_line(ne_def)
 
-            # SBModule has extra SBSection, SBCompileUnit iterators and symbol_in_section_iter()!
+            # SBModule has extra SBSection, SBCompileUnit iterators and
+            # symbol_in_section_iter()!
             if cls == "SBModule":
-                new_content.add_line(section_iter % d[cls+'-section'])
-                new_content.add_line(compile_unit_iter % d[cls+'-compile-unit'])
-                new_content.add_line(d[cls+'-symbol-in-section'])
+                new_content.add_line(section_iter % d[cls + '-section'])
+                new_content.add_line(compile_unit_iter %
+                                     d[cls + '-compile-unit'])
+                new_content.add_line(d[cls + '-symbol-in-section'])
 
             # This special purpose iterator is for SBValue only!!!
             if cls == "SBValue":
@@ -483,4 +498,3 @@ target = SBTarget()
 process = SBProcess()
 thread = SBThread()
 frame = SBFrame()''')
-

Modified: lldb/trunk/scripts/Python/modules/readline/readline.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/modules/readline/readline.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/modules/readline/readline.cpp (original)
+++ lldb/trunk/scripts/Python/modules/readline/readline.cpp Tue Sep  6 15:57:50 2016
@@ -21,18 +21,15 @@
 // readline.so linked against GNU readline.
 
 #ifndef LLDB_DISABLE_LIBEDIT
-PyDoc_STRVAR(
-    moduleDocumentation,
-    "Simple readline module implementation based on libedit.");
+PyDoc_STRVAR(moduleDocumentation,
+             "Simple readline module implementation based on libedit.");
 #else
-PyDoc_STRVAR(
-    moduleDocumentation,
-    "Stub module meant to avoid linking GNU readline.");
+PyDoc_STRVAR(moduleDocumentation,
+             "Stub module meant to avoid linking GNU readline.");
 #endif
 
 #if PY_MAJOR_VERSION >= 3
-static struct PyModuleDef readline_module =
-{
+static struct PyModuleDef readline_module = {
     PyModuleDef_HEAD_INIT, // m_base
     "readline",            // m_name
     moduleDocumentation,   // m_doc
@@ -44,57 +41,47 @@ static struct PyModuleDef readline_modul
     nullptr,               // m_free
 };
 #else
-static struct PyMethodDef moduleMethods[] =
-{
-    {nullptr, nullptr, 0, nullptr}
-};
+static struct PyMethodDef moduleMethods[] = {{nullptr, nullptr, 0, nullptr}};
 #endif
 
 #ifndef LLDB_DISABLE_LIBEDIT
-static char*
+static char *
 #if PY_MAJOR_VERSION >= 3
 simple_readline(FILE *stdin, FILE *stdout, const char *prompt)
 #else
 simple_readline(FILE *stdin, FILE *stdout, char *prompt)
 #endif
 {
-    rl_instream = stdin;
-    rl_outstream = stdout;
-    char* line = readline(prompt);
-    if (!line)
-    {
-        char* ret = (char*)PyMem_Malloc(1);
-        if (ret != NULL)
-            *ret = '\0';
-        return ret;
-    }
-    if (*line)
-        add_history(line);
-    int n = strlen(line);
-    char* ret = (char*)PyMem_Malloc(n + 2);
-    strncpy(ret, line, n);
-    free(line);
-    ret[n] = '\n';
-    ret[n+1] = '\0';
+  rl_instream = stdin;
+  rl_outstream = stdout;
+  char *line = readline(prompt);
+  if (!line) {
+    char *ret = (char *)PyMem_Malloc(1);
+    if (ret != NULL)
+      *ret = '\0';
     return ret;
+  }
+  if (*line)
+    add_history(line);
+  int n = strlen(line);
+  char *ret = (char *)PyMem_Malloc(n + 2);
+  strncpy(ret, line, n);
+  free(line);
+  ret[n] = '\n';
+  ret[n + 1] = '\0';
+  return ret;
 }
 #endif
 
-PyMODINIT_FUNC
-initreadline(void)
-{
+PyMODINIT_FUNC initreadline(void) {
 #ifndef LLDB_DISABLE_LIBEDIT
-    PyOS_ReadlineFunctionPointer = simple_readline;
+  PyOS_ReadlineFunctionPointer = simple_readline;
 #endif
 
 #if PY_MAJOR_VERSION >= 3
-    return PyModule_Create(&readline_module);
+  return PyModule_Create(&readline_module);
 #else
-    Py_InitModule4(
-        "readline",
-        moduleMethods,
-        moduleDocumentation,
-        static_cast<PyObject *>(NULL),
-        PYTHON_API_VERSION);
+  Py_InitModule4("readline", moduleMethods, moduleDocumentation,
+                 static_cast<PyObject *>(NULL), PYTHON_API_VERSION);
 #endif
 }

Modified: lldb/trunk/scripts/Python/prepare_binding_Python.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/prepare_binding_Python.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/prepare_binding_Python.py (original)
+++ lldb/trunk/scripts/Python/prepare_binding_Python.py Tue Sep  6 15:57:50 2016
@@ -18,8 +18,10 @@ import subprocess
 import sys
 import platform
 
+
 class SwigSettings(object):
     """Provides a single object to represent swig files and settings."""
+
     def __init__(self):
         self.extensions_file = None
         self.header_files = None
@@ -213,7 +215,7 @@ def do_swig_rebuild(options, dependency_
         "-outdir", "\"%s\"" % config_build_dir,
         "-o", "\"%s\"" % settings.output_file,
         "\"%s\"" % settings.input_file
-        ])
+    ])
     logging.info("running swig with: %s", command)
 
     # Execute swig

Modified: lldb/trunk/scripts/Python/remote-build.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/remote-build.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/remote-build.py (original)
+++ lldb/trunk/scripts/Python/remote-build.py Tue Sep  6 15:57:50 2016
@@ -14,6 +14,7 @@ import subprocess
 _COMMON_SYNC_OPTS = "-avzh --delete"
 _COMMON_EXCLUDE_OPTS = "--exclude=DerivedData --exclude=.svn --exclude=.git --exclude=llvm-build/Release+Asserts"
 
+
 def normalize_configuration(config_text):
     if not config_text:
         return "debug"
@@ -24,6 +25,7 @@ def normalize_configuration(config_text)
     else:
         raise Exception("unknown configuration specified: %s" % config_text)
 
+
 def parse_args():
     DEFAULT_REMOTE_ROOT_DIR = "/mnt/ssd/work/macosx.sync"
     DEFAULT_REMOTE_HOSTNAME = "tfiala2.mtv.corp.google.com"
@@ -33,9 +35,13 @@ def parse_args():
     parser = argparse.ArgumentParser(fromfile_prefix_chars='@')
 
     parser.add_argument(
-        "--configuration", "-c",
+        "--configuration",
+        "-c",
         help="specify configuration (Debug, Release)",
-        default=normalize_configuration(os.environ.get('CONFIGURATION', 'Debug')))
+        default=normalize_configuration(
+            os.environ.get(
+                'CONFIGURATION',
+                'Debug')))
     parser.add_argument(
         "--debug", "-d",
         action="store_true",
@@ -60,11 +66,16 @@ def parse_args():
         "--user", "-u", help="specify the user name for the remote system",
         default=getpass.getuser())
     parser.add_argument(
-        "--xcode-action", "-x", help="$(ACTION) from Xcode", nargs='?', default=None)
+        "--xcode-action",
+        "-x",
+        help="$(ACTION) from Xcode",
+        nargs='?',
+        default=None)
 
     command_line_args = sys.argv[1:]
     if os.path.exists(OPTIONS_FILENAME):
-        # Prepend the file so that command line args override the file contents.
+        # Prepend the file so that command line args override the file
+        # contents.
         command_line_args.insert(0, "@%s" % OPTIONS_FILENAME)
 
     return parser.parse_args(command_line_args)
@@ -102,7 +113,8 @@ def init_with_args(args):
             "local lldb root needs to be called 'lldb' but was {} instead"
             .format(os.path.basename(args.local_lldb_dir)))
 
-    args.lldb_dir_relative_regex = re.compile("%s/llvm/tools/lldb/" % args.remote_dir)
+    args.lldb_dir_relative_regex = re.compile(
+        "%s/llvm/tools/lldb/" % args.remote_dir)
     args.llvm_dir_relative_regex = re.compile("%s/" % args.remote_dir)
 
     print("Xcode action:", args.xcode_action)
@@ -118,6 +130,7 @@ def init_with_args(args):
 
     return True
 
+
 def sync_llvm(args):
     commandline = ["rsync"]
     commandline.extend(_COMMON_SYNC_OPTS.split())
@@ -138,9 +151,8 @@ def sync_lldb(args):
     commandline.extend(_COMMON_EXCLUDE_OPTS.split())
     commandline.append("--exclude=/lldb/llvm")
     commandline.extend(["-e", "ssh -p {}".format(args.port)])
-    commandline.extend([
-        args.local_lldb_dir,
-        "%s@%s:%s/llvm/tools" % (args.user, args.remote_address, args.remote_dir)])
+    commandline.extend([args.local_lldb_dir, "%s@%s:%s/llvm/tools" %
+                        (args.user, args.remote_address, args.remote_dir)])
     if args.debug:
         print("going to execute lldb sync: {}".format(commandline))
     return subprocess.call(commandline)
@@ -174,7 +186,7 @@ def build_cmake_command(args):
         "-DCMAKE_BUILD_TYPE=%s" % build_type_name,
         "-Wno-dev",
         os.path.join("..", "llvm")
-        ]
+    ]
 
     return command_line
 
@@ -187,7 +199,7 @@ def maybe_configure(args):
         "cd", args.remote_dir, "&&",
         "mkdir", "-p", args.remote_build_dir, "&&",
         "cd", args.remote_build_dir, "&&"
-        ]
+    ]
     commandline.extend(build_cmake_command(args))
 
     if args.debug:
@@ -243,7 +255,7 @@ def run_remote_build_command(args, build
                     print(display_line, file=sys.stderr)
 
         proc_retval = proc.poll()
-        if proc_retval != None:
+        if proc_retval is not None:
             # Process stopped.  Drain output before finishing up.
 
             # Drain stdout.

Modified: lldb/trunk/scripts/Python/use_lldb_suite.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/use_lldb_suite.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/use_lldb_suite.py (original)
+++ lldb/trunk/scripts/Python/use_lldb_suite.py Tue Sep  6 15:57:50 2016
@@ -2,6 +2,7 @@ import inspect
 import os
 import sys
 
+
 def find_lldb_root():
     lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe()))
     while True:

Modified: lldb/trunk/scripts/Xcode/build-llvm.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/build-llvm.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/Xcode/build-llvm.py (original)
+++ lldb/trunk/scripts/Xcode/build-llvm.py Tue Sep  6 15:57:50 2016
@@ -13,64 +13,72 @@ from lldbbuild import *
 
 #### SETTINGS ####
 
-def LLVM_HASH_INCLUDES_DIFFS ():
+
+def LLVM_HASH_INCLUDES_DIFFS():
     return False
 
 # The use of "x = "..."; return x" here is important because tooling looks for
 # it with regexps.  Only change how this works if you know what you are doing.
 
-def LLVM_REF ():
+
+def LLVM_REF():
     llvm_ref = "master"
     return llvm_ref
 
-def CLANG_REF ():
+
+def CLANG_REF():
     clang_ref = "master"
     return clang_ref
 
 # For use with Xcode-style builds
 
-def XCODE_REPOSITORIES ():
+
+def XCODE_REPOSITORIES():
     return [
-        { 'name':   "llvm",
-          'vcs':    VCS.git,
-          'root':   llvm_source_path(),
-          'url':    "http://llvm.org/git/llvm.git",
-          'ref':    LLVM_REF() },
-
-        { 'name':   "clang",
-          'vcs':    VCS.git,
-          'root':   clang_source_path(),
-          'url':    "http://llvm.org/git/clang.git",
-          'ref':    CLANG_REF() },
-
-        { 'name':   "ninja",
-          'vcs':    VCS.git,
-          'root':   ninja_source_path(),
-          'url':    "https://github.com/ninja-build/ninja.git",
-          'ref':    "master" }
+        {'name': "llvm",
+         'vcs': VCS.git,
+         'root': llvm_source_path(),
+         'url': "http://llvm.org/git/llvm.git",
+         'ref': LLVM_REF()},
+
+        {'name': "clang",
+         'vcs': VCS.git,
+         'root': clang_source_path(),
+         'url': "http://llvm.org/git/clang.git",
+         'ref': CLANG_REF()},
+
+        {'name': "ninja",
+         'vcs': VCS.git,
+         'root': ninja_source_path(),
+         'url': "https://github.com/ninja-build/ninja.git",
+         'ref': "master"}
     ]
 
-def get_c_compiler ():
+
+def get_c_compiler():
     return subprocess.check_output([
         'xcrun',
         '--sdk', 'macosx',
         '-find', 'clang'
-        ]).rstrip()
+    ]).rstrip()
+
 
-def get_cxx_compiler ():
+def get_cxx_compiler():
     return subprocess.check_output([
         'xcrun',
         '--sdk', 'macosx',
         '-find', 'clang++'
-        ]).rstrip()
+    ]).rstrip()
 
 #                 CFLAGS="-isysroot $(xcrun --sdk macosx --show-sdk-path) -mmacosx-version-min=${DARWIN_DEPLOYMENT_VERSION_OSX}" \
 #                        LDFLAGS="-mmacosx-version-min=${DARWIN_DEPLOYMENT_VERSION_OSX}" \
 
-def get_deployment_target ():
+
+def get_deployment_target():
     return os.environ.get('MACOSX_DEPLOYMENT_TARGET', None)
 
-def get_c_flags ():
+
+def get_c_flags():
     cflags = ''
     # sdk_path = subprocess.check_output([
     #     'xcrun',
@@ -78,19 +86,21 @@ def get_c_flags ():
     #     '--show-sdk-path']).rstrip()
     # cflags += '-isysroot {}'.format(sdk_path)
 
-    deployment_target = get_deployment_target() 
+    deployment_target = get_deployment_target()
     if deployment_target:
         # cflags += ' -mmacosx-version-min={}'.format(deployment_target)
         pass
 
     return cflags
 
-def get_cxx_flags ():
+
+def get_cxx_flags():
     return get_c_flags()
 
-def get_common_linker_flags ():
+
+def get_common_linker_flags():
     linker_flags = ""
-    deployment_target = get_deployment_target() 
+    deployment_target = get_deployment_target()
     if deployment_target:
         # if len(linker_flags) > 0:
         #     linker_flags += ' '
@@ -99,50 +109,62 @@ def get_common_linker_flags ():
 
     return linker_flags
 
-def get_exe_linker_flags ():
+
+def get_exe_linker_flags():
     return get_common_linker_flags()
 
-def get_shared_linker_flags ():
+
+def get_shared_linker_flags():
     return get_common_linker_flags()
 
-def CMAKE_FLAGS ():
+
+def CMAKE_FLAGS():
     return {
         "Debug": [
             "-DCMAKE_BUILD_TYPE=RelWithDebInfo",
             "-DLLVM_ENABLE_ASSERTIONS=ON",
-            ],
+        ],
         "DebugClang": [
             "-DCMAKE_BUILD_TYPE=Debug",
             "-DLLVM_ENABLE_ASSERTIONS=ON",
-            ],
+        ],
         "Release": [
             "-DCMAKE_BUILD_TYPE=Release",
             "-DLLVM_ENABLE_ASSERTIONS=ON",
-            ],
+        ],
         "BuildAndIntegration": [
             "-DCMAKE_BUILD_TYPE=Release",
             "-DLLVM_ENABLE_ASSERTIONS=OFF",
-            ],
+        ],
     }
 
-def CMAKE_ENVIRONMENT ():
+
+def CMAKE_ENVIRONMENT():
     return {
     }
 
 #### COLLECTING ALL ARCHIVES ####
 
-def collect_archives_in_path (path): 
+
+def collect_archives_in_path(path):
     files = os.listdir(path)
     # Only use libclang and libLLVM archives, and exclude libclang_rt
     regexp = "^lib(clang[^_]|LLVM|gtest).*$"
-    return [os.path.join(path, file) for file in files if file.endswith(".a") and re.match(regexp, file)]
+    return [
+        os.path.join(
+            path,
+            file) for file in files if file.endswith(".a") and re.match(
+            regexp,
+            file)]
 
-def archive_list ():
+
+def archive_list():
     paths = library_paths()
     archive_lists = [collect_archives_in_path(path) for path in paths]
     return [archive for archive_list in archive_lists for archive in archive_list]
 
-def write_archives_txt ():
+
+def write_archives_txt():
     f = open(archives_txt(), 'w')
     for archive in archive_list():
         f.write(archive + "\n")
@@ -150,70 +172,92 @@ def write_archives_txt ():
 
 #### COLLECTING REPOSITORY MD5S ####
 
-def source_control_status (spec):
+
+def source_control_status(spec):
     vcs_for_spec = vcs(spec)
     if LLVM_HASH_INCLUDES_DIFFS():
         return vcs_for_spec.status() + vcs_for_spec.diff()
     else:
         return vcs_for_spec.status()
 
-def source_control_status_for_specs (specs):
+
+def source_control_status_for_specs(specs):
     statuses = [source_control_status(spec) for spec in specs]
     return "".join(statuses)
 
-def all_source_control_status ():
+
+def all_source_control_status():
     return source_control_status_for_specs(XCODE_REPOSITORIES())
 
-def md5 (string):
+
+def md5(string):
     m = hashlib.md5()
     m.update(string)
     return m.hexdigest()
 
-def all_source_control_status_md5 ():
+
+def all_source_control_status_md5():
     return md5(all_source_control_status())
 
 #### CHECKING OUT AND BUILDING LLVM ####
 
+
 def apply_patches(spec):
     files = os.listdir(os.path.join(lldb_source_path(), 'scripts'))
-    patches = [f for f in files if fnmatch.fnmatch(f, spec['name'] + '.*.diff')]
+    patches = [
+        f for f in files if fnmatch.fnmatch(
+            f, spec['name'] + '.*.diff')]
     for p in patches:
-        run_in_directory(["patch", "-p0", "-i", os.path.join(lldb_source_path(), 'scripts', p)], spec['root'])
+        run_in_directory(["patch",
+                          "-p0",
+                          "-i",
+                          os.path.join(lldb_source_path(),
+                                       'scripts',
+                                       p)],
+                         spec['root'])
+
 
 def check_out_if_needed(spec):
     if not os.path.isdir(spec['root']):
         vcs(spec).check_out()
         apply_patches(spec)
 
-def all_check_out_if_needed ():
-    map (check_out_if_needed, XCODE_REPOSITORIES())
 
-def should_build_llvm ():
+def all_check_out_if_needed():
+    map(check_out_if_needed, XCODE_REPOSITORIES())
+
+
+def should_build_llvm():
     if build_type() == BuildType.Xcode:
         # TODO use md5 sums
         return True
 
-def do_symlink (source_path, link_path):
+
+def do_symlink(source_path, link_path):
     print "Symlinking " + source_path + " to " + link_path
     if not os.path.exists(link_path):
         os.symlink(source_path, link_path)
 
-def setup_source_symlink (repo):
+
+def setup_source_symlink(repo):
     source_path = repo["root"]
     link_path = os.path.join(lldb_source_path(), os.path.basename(source_path))
     do_symlink(source_path, link_path)
 
-def setup_source_symlinks ():
+
+def setup_source_symlinks():
     map(setup_source_symlink, XCODE_REPOSITORIES())
 
-def setup_build_symlink ():
+
+def setup_build_symlink():
     # We don't use the build symlinks in llvm.org Xcode-based builds.
     if build_type() != BuildType.Xcode:
         source_path = package_build_path()
         link_path = expected_package_build_path()
         do_symlink(source_path, link_path)
 
-def should_run_cmake (cmake_build_dir):
+
+def should_run_cmake(cmake_build_dir):
     # We need to run cmake if our llvm build directory doesn't yet exist.
     if not os.path.exists(cmake_build_dir):
         return True
@@ -224,14 +268,17 @@ def should_run_cmake (cmake_build_dir):
     ninja_path = os.path.join(cmake_build_dir, "build.ninja")
     return not os.path.exists(ninja_path)
 
-def cmake_environment ():
+
+def cmake_environment():
     cmake_env = join_dicts(os.environ, CMAKE_ENVIRONMENT())
     return cmake_env
 
+
 def is_executable(path):
     return os.path.isfile(path) and os.access(path, os.X_OK)
 
-def find_executable_in_paths (program, paths_to_check):
+
+def find_executable_in_paths(program, paths_to_check):
     program_dir, program_name = os.path.split(program)
     if program_dir:
         if is_executable(program):
@@ -244,14 +291,16 @@ def find_executable_in_paths (program, p
                 return executable_file
     return None
 
-def find_cmake ():
+
+def find_cmake():
     # First check the system PATH env var for cmake
-    cmake_binary = find_executable_in_paths("cmake", os.environ["PATH"].split(os.pathsep))
+    cmake_binary = find_executable_in_paths(
+        "cmake", os.environ["PATH"].split(os.pathsep))
     if cmake_binary:
         # We found it there, use it.
         return cmake_binary
 
-    # Check a few more common spots.  Xcode launched from Finder 
+    # Check a few more common spots.  Xcode launched from Finder
     # will have the default environment, and may not have
     # all the normal places present.
     extra_cmake_dirs = [
@@ -263,18 +312,18 @@ def find_cmake ():
     if platform.system() == "Darwin":
         # Add locations where an official CMake.app package may be installed.
         extra_cmake_dirs.extend([
-           os.path.join(
-               os.path.expanduser("~"),
-               "Applications",
-               "CMake.app",
-               "Contents",
-               "bin"),
-           os.path.join(
-               os.sep,
-               "Applications",
-               "CMake.app",
-               "Contents",
-               "bin")])
+            os.path.join(
+                os.path.expanduser("~"),
+                "Applications",
+                "CMake.app",
+                "Contents",
+                "bin"),
+            os.path.join(
+                os.sep,
+                "Applications",
+                "CMake.app",
+                "Contents",
+                "bin")])
 
     cmake_binary = find_executable_in_paths("cmake", extra_cmake_dirs)
     if cmake_binary:
@@ -285,38 +334,42 @@ def find_cmake ():
     raise Exception(
         "could not find cmake in PATH ({}) or in any of these locations ({}), "
         "please install cmake or add a link to it in one of those locations".format(
-            os.environ["PATH"],
-            extra_cmake_dirs))
+            os.environ["PATH"], extra_cmake_dirs))
 
-def cmake_flags ():
+
+def cmake_flags():
     cmake_flags = CMAKE_FLAGS()[lldb_configuration()]
-    cmake_flags += [
-            "-GNinja",
-            "-DCMAKE_C_COMPILER={}".format(get_c_compiler()),
-            "-DCMAKE_CXX_COMPILER={}".format(get_cxx_compiler()),
-            "-DCMAKE_INSTALL_PREFIX={}".format(expected_package_build_path_for("llvm")),
-            "-DCMAKE_C_FLAGS={}".format(get_c_flags()),
-            "-DCMAKE_CXX_FLAGS={}".format(get_cxx_flags()),
-            "-DCMAKE_EXE_LINKER_FLAGS={}".format(get_exe_linker_flags()),
-            "-DCMAKE_SHARED_LINKER_FLAGS={}".format(get_shared_linker_flags())
-            ]
+    cmake_flags += ["-GNinja",
+                    "-DCMAKE_C_COMPILER={}".format(get_c_compiler()),
+                    "-DCMAKE_CXX_COMPILER={}".format(get_cxx_compiler()),
+                    "-DCMAKE_INSTALL_PREFIX={}".format(expected_package_build_path_for("llvm")),
+                    "-DCMAKE_C_FLAGS={}".format(get_c_flags()),
+                    "-DCMAKE_CXX_FLAGS={}".format(get_cxx_flags()),
+                    "-DCMAKE_EXE_LINKER_FLAGS={}".format(get_exe_linker_flags()),
+                    "-DCMAKE_SHARED_LINKER_FLAGS={}".format(get_shared_linker_flags())]
     deployment_target = get_deployment_target()
     if deployment_target:
-        cmake_flags.append("-DCMAKE_OSX_DEPLOYMENT_TARGET={}".format(deployment_target))
+        cmake_flags.append(
+            "-DCMAKE_OSX_DEPLOYMENT_TARGET={}".format(deployment_target))
     return cmake_flags
 
-def run_cmake (cmake_build_dir, ninja_binary_path):
+
+def run_cmake(cmake_build_dir, ninja_binary_path):
     cmake_binary = find_cmake()
     print "found cmake binary: using \"{}\"".format(cmake_binary)
 
     command_line = [cmake_binary] + cmake_flags() + [
-            "-DCMAKE_MAKE_PROGRAM={}".format(ninja_binary_path),
-            llvm_source_path()]
+        "-DCMAKE_MAKE_PROGRAM={}".format(ninja_binary_path),
+        llvm_source_path()]
     print "running cmake like so: ({}) in dir ({})".format(command_line, cmake_build_dir)
 
-    subprocess.check_call(command_line, cwd=cmake_build_dir, env=cmake_environment())
+    subprocess.check_call(
+        command_line,
+        cwd=cmake_build_dir,
+        env=cmake_environment())
+
 
-def create_directories_as_needed (path):
+def create_directories_as_needed(path):
     try:
         os.makedirs(path)
     except OSError as error:
@@ -325,16 +378,19 @@ def create_directories_as_needed (path):
         if error.errno != errno.EEXIST:
             raise error
 
-def run_cmake_if_needed (ninja_binary_path):
+
+def run_cmake_if_needed(ninja_binary_path):
     cmake_build_dir = package_build_path()
     if should_run_cmake(cmake_build_dir):
         # Create the build directory as needed
-        create_directories_as_needed (cmake_build_dir)
+        create_directories_as_needed(cmake_build_dir)
         run_cmake(cmake_build_dir, ninja_binary_path)
 
-def build_ninja_if_needed ():
+
+def build_ninja_if_needed():
     # First check if ninja is in our path.  If so, there's nothing to do.
-    ninja_binary_path = find_executable_in_paths("ninja", os.environ["PATH"].split(os.pathsep))
+    ninja_binary_path = find_executable_in_paths(
+        "ninja", os.environ["PATH"].split(os.pathsep))
     if ninja_binary_path:
         # It's on the path.  cmake will find it.  We're good.
         print "found ninja here: \"{}\"".format(ninja_binary_path)
@@ -347,20 +403,29 @@ def build_ninja_if_needed ():
         # Build ninja
         command_line = ["python", "configure.py", "--bootstrap"]
         print "building ninja like so: ({}) in dir ({})".format(command_line, ninja_build_dir)
-        subprocess.check_call(command_line, cwd=ninja_build_dir, env=os.environ)
+        subprocess.check_call(
+            command_line,
+            cwd=ninja_build_dir,
+            env=os.environ)
 
     return ninja_binary_path
 
-def join_dicts (dict1, dict2):
+
+def join_dicts(dict1, dict2):
     d = dict1.copy()
     d.update(dict2)
     return d
 
-def build_llvm (ninja_binary_path):
+
+def build_llvm(ninja_binary_path):
     cmake_build_dir = package_build_path()
-    subprocess.check_call([ninja_binary_path], cwd=cmake_build_dir, env=cmake_environment())
+    subprocess.check_call(
+        [ninja_binary_path],
+        cwd=cmake_build_dir,
+        env=cmake_environment())
+
 
-def build_llvm_if_needed ():
+def build_llvm_if_needed():
     if should_build_llvm():
         ninja_binary_path = build_ninja_if_needed()
         run_cmake_if_needed(ninja_binary_path)

Modified: lldb/trunk/scripts/Xcode/lldbbuild.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/lldbbuild.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/Xcode/lldbbuild.py (original)
+++ lldb/trunk/scripts/Xcode/lldbbuild.py Tue Sep  6 15:57:50 2016
@@ -3,7 +3,8 @@ import subprocess
 
 #### UTILITIES ####
 
-def enum (*sequential, **named):
+
+def enum(*sequential, **named):
     enums = dict(zip(sequential, range(len(sequential))), **named)
     return type('Enum', (), enums)
 
@@ -11,42 +12,53 @@ def enum (*sequential, **named):
 
 #### INTERFACE TO THE XCODEPROJ ####
 
-def lldb_source_path ():
+
+def lldb_source_path():
     return os.environ.get('SRCROOT')
 
-def expected_llvm_build_path ():
+
+def expected_llvm_build_path():
     if build_type() == BuildType.Xcode:
         return package_build_path()
     else:
-        return os.path.join(os.environ.get('LLDB_PATH_TO_LLVM_BUILD'), package_build_dir_name("llvm"))
+        return os.path.join(
+            os.environ.get('LLDB_PATH_TO_LLVM_BUILD'),
+            package_build_dir_name("llvm"))
+
 
-def archives_txt ():
+def archives_txt():
     return os.path.join(expected_package_build_path(), "archives.txt")
 
-def expected_package_build_path ():
+
+def expected_package_build_path():
     return os.path.abspath(os.path.join(expected_llvm_build_path(), ".."))
 
-def architecture ():
+
+def architecture():
     platform_name = os.environ.get('RC_PLATFORM_NAME')
     if not platform_name:
         platform_name = os.environ.get('PLATFORM_NAME')
     platform_arch = os.environ.get('ARCHS').split()[-1]
     return platform_name + "-" + platform_arch
 
-def lldb_configuration ():
+
+def lldb_configuration():
     return os.environ.get('CONFIGURATION')
 
-def llvm_configuration ():
+
+def llvm_configuration():
     return os.environ.get('LLVM_CONFIGURATION')
 
-def llvm_build_dirtree ():
+
+def llvm_build_dirtree():
     return os.environ.get('LLVM_BUILD_DIRTREE')
 
 # Edit the code below when adding build styles.
 
 BuildType = enum('Xcode')                # (Debug,DebugClang,Release)
 
-def build_type ():
+
+def build_type():
     return BuildType.Xcode
 
 #### VCS UTILITIES ####
@@ -54,31 +66,48 @@ def build_type ():
 VCS = enum('git',
            'svn')
 
+
 def run_in_directory(args, path):
     return subprocess.check_output(args, cwd=path)
 
+
 class Git:
-    def __init__ (self, spec):
+
+    def __init__(self, spec):
         self.spec = spec
-    def status (self):
+
+    def status(self):
         return run_in_directory(["git", "branch", "-v"], self.spec['root'])
-    def diff (self):
+
+    def diff(self):
         return run_in_directory(["git", "diff"], self.spec['root'])
-    def check_out (self):
-        run_in_directory(["git", "clone", "--depth=1", self.spec['url'], self.spec['root']], lldb_source_path())
+
+    def check_out(self):
+        run_in_directory(["git",
+                          "clone",
+                          "--depth=1",
+                          self.spec['url'],
+                          self.spec['root']],
+                         lldb_source_path())
         run_in_directory(["git", "fetch", "--all"], self.spec['root'])
-        run_in_directory(["git", "checkout", self.spec['ref']], self.spec['root'])
+        run_in_directory(["git", "checkout", self.spec[
+                         'ref']], self.spec['root'])
+
 
 class SVN:
-    def __init__ (self, spec):
+
+    def __init__(self, spec):
         self.spec = spec
-    def status (self):
+
+    def status(self):
         return run_in_directory(["svn", "info"], self.spec['root'])
-    def diff (self):
+
+    def diff(self):
         return run_in_directory(["svn", "diff"], self.spec['root'])
     # TODO implement check_out
 
-def vcs (spec):
+
+def vcs(spec):
     if spec['vcs'] == VCS.git:
         return Git(spec)
     elif spec['vcs'] == VCS.svn:
@@ -88,47 +117,59 @@ def vcs (spec):
 
 #### SOURCE PATHS ####
 
-def llvm_source_path ():
+
+def llvm_source_path():
     if build_type() == BuildType.Xcode:
         return os.path.join(lldb_source_path(), "llvm")
 
-def clang_source_path ():
+
+def clang_source_path():
     if build_type() == BuildType.Xcode:
         return os.path.join(llvm_source_path(), "tools", "clang")
 
-def ninja_source_path ():
+
+def ninja_source_path():
     if build_type() == BuildType.Xcode:
         return os.path.join(lldb_source_path(), "ninja")
 
 #### BUILD PATHS ####
 
-def packages ():
+
+def packages():
     return ["llvm"]
 
-def package_build_dir_name (package):
+
+def package_build_dir_name(package):
     return package + "-" + architecture()
 
-def expected_package_build_path_for (package):
+
+def expected_package_build_path_for(package):
     if build_type() == BuildType.Xcode:
         if package != "llvm":
-            raise("On Xcode build, we only support the llvm package: requested {}".format(package))
+            raise "On Xcode build, we only support the llvm package: requested {}"
         return package_build_path()
-    return os.path.join(expected_package_build_path(), package_build_dir_name(package))
+    return os.path.join(
+        expected_package_build_path(),
+        package_build_dir_name(package))
 
-def expected_package_build_paths ():
+
+def expected_package_build_paths():
     return [expected_package_build_path_for(package) for package in packages()]
 
-def library_path (build_path):
+
+def library_path(build_path):
     return build_path + "/lib"
 
-def library_paths ():
+
+def library_paths():
     if build_type() == BuildType.Xcode:
         package_build_paths = [package_build_path()]
     else:
         package_build_paths = expected_package_build_paths()
     return [library_path(build_path) for build_path in package_build_paths]
 
-def package_build_path ():
+
+def package_build_path():
     return os.path.join(
         llvm_build_dirtree(),
         os.environ["LLVM_CONFIGURATION"],

Modified: lldb/trunk/scripts/Xcode/package-clang-headers.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/package-clang-headers.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/Xcode/package-clang-headers.py (original)
+++ lldb/trunk/scripts/Xcode/package-clang-headers.py Tue Sep  6 15:57:50 2016
@@ -17,24 +17,24 @@ import sys
 import lldbbuild
 
 if len(sys.argv) != 3:
-     print "usage: " + sys.argv[0] + " TARGET_DIR LLVM_BUILD_DIR"
-     sys.exit(1)
+    print "usage: " + sys.argv[0] + " TARGET_DIR LLVM_BUILD_DIR"
+    sys.exit(1)
 
 target_dir = sys.argv[1]
 llvm_build_dir = lldbbuild.expected_package_build_path_for("llvm")
 
 if not os.path.isdir(target_dir):
     print target_dir + " doesn't exist"
-    sys.exit(1) 
+    sys.exit(1)
 
 if not os.path.isdir(llvm_build_dir):
-    llvm_build_dir = re.sub ("-macosx-", "-iphoneos-", llvm_build_dir)
+    llvm_build_dir = re.sub("-macosx-", "-iphoneos-", llvm_build_dir)
 
 if not os.path.isdir(llvm_build_dir):
-    llvm_build_dir = re.sub ("-iphoneos-", "-appletvos-", llvm_build_dir)
+    llvm_build_dir = re.sub("-iphoneos-", "-appletvos-", llvm_build_dir)
 
 if not os.path.isdir(llvm_build_dir):
-    llvm_build_dir = re.sub ("-appletvos-", "-watchos-", llvm_build_dir)
+    llvm_build_dir = re.sub("-appletvos-", "-watchos-", llvm_build_dir)
 
 if not os.path.isdir(llvm_build_dir):
     print llvm_build_dir + " doesn't exist"
@@ -59,7 +59,7 @@ for subdir in os.listdir(clang_dir):
         version_dir = os.path.join(clang_dir, subdir)
         break
 
-if version_dir == None:
+if version_dir is None:
     print "Couldn't find a subdirectory of the form #(.#)... in " + clang_dir
     sys.exit(1)
 

Modified: lldb/trunk/scripts/buildbot.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/buildbot.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/buildbot.py (original)
+++ lldb/trunk/scripts/buildbot.py Tue Sep  6 15:57:50 2016
@@ -7,7 +7,9 @@ import shutil
 import subprocess
 import sys
 
+
 class BuildError(Exception):
+
     def __init__(self,
                  string=None,
                  path=None,
@@ -15,23 +17,28 @@ class BuildError(Exception):
         self.m_string = string
         self.m_path = path
         self.m_inferior_error = inferior_error
+
     def __str__(self):
         if self.m_path and self.m_string:
-            return "Build error: %s (referring to %s)" % (self.m_string, self.m_path)
+            return "Build error: %s (referring to %s)" % (
+                self.m_string, self.m_path)
         if self.m_path:
             return "Build error (referring to %s)" % (self.m_path)
         if self.m_string:
             return "Build error: %s" % (self.m_string)
         return "Build error"
 
+
 class LLDBBuildBot:
-    def __init__(self, 
-                 build_directory_path,
-                 log_path,
-                 lldb_repository_url="http://llvm.org/svn/llvm-project/lldb/trunk",
-                 llvm_repository_url="http://llvm.org/svn/llvm-project/llvm/trunk",
-                 clang_repository_url="http://llvm.org/svn/llvm-project/cfe/trunk",
-                 revision=None):
+
+    def __init__(
+            self,
+            build_directory_path,
+            log_path,
+            lldb_repository_url="http://llvm.org/svn/llvm-project/lldb/trunk",
+            llvm_repository_url="http://llvm.org/svn/llvm-project/llvm/trunk",
+            clang_repository_url="http://llvm.org/svn/llvm-project/cfe/trunk",
+            revision=None):
         self.m_build_directory_path = os.path.abspath(build_directory_path)
         self.m_log_path = os.path.abspath(log_path)
         self.m_lldb_repository_url = lldb_repository_url
@@ -39,34 +46,44 @@ class LLDBBuildBot:
         self.m_clang_repository_url = clang_repository_url
         self.m_revision = revision
         self.m_log_stream = None
+
     def Setup(self):
         if os.path.exists(self.m_build_directory_path):
-            raise BuildError(string="Build directory exists", path=self.m_build_directory_path)
+            raise BuildError(
+                string="Build directory exists",
+                path=self.m_build_directory_path)
         if os.path.exists(self.m_log_path):
             raise BuildError(string="Log file exists", path=self.m_log_path)
         self.m_log_stream = open(self.m_log_path, 'w')
         os.mkdir(self.m_build_directory_path)
+
     def Checkout(self):
         os.chdir(self.m_build_directory_path)
-        
+
         cmdline_prefix = []
-        
-        if self.m_revision != None:
+
+        if self.m_revision is not None:
             cmdline_prefix = ["svn", "-r %s" % (self.m_revision), "co"]
         else:
             cmdline_prefix = ["svn", "co"]
 
-        returncode = subprocess.call(cmdline_prefix + [self.m_lldb_repository_url, "lldb"], 
-                                     stdout=self.m_log_stream, 
-                                     stderr=self.m_log_stream)
+        returncode = subprocess.call(
+            cmdline_prefix + [
+                self.m_lldb_repository_url,
+                "lldb"],
+            stdout=self.m_log_stream,
+            stderr=self.m_log_stream)
         if returncode != 0:
             raise BuildError(string="Couldn't checkout LLDB")
 
         os.chdir("lldb")
 
-        returncode = subprocess.call(cmdline_prefix + [self.m_llvm_repository_url, "llvm.checkout"], 
-                                     stdout=self.m_log_stream, 
-                                     stderr=self.m_log_stream)
+        returncode = subprocess.call(
+            cmdline_prefix + [
+                self.m_llvm_repository_url,
+                "llvm.checkout"],
+            stdout=self.m_log_stream,
+            stderr=self.m_log_stream)
 
         if returncode != 0:
             raise BuildError(string="Couldn't checkout LLVM")
@@ -75,25 +92,32 @@ class LLDBBuildBot:
 
         os.chdir("llvm/tools")
 
-        returncode = subprocess.call(cmdline_prefix + [self.m_clang_repository_url, "clang"], 
-                                     stdout=self.m_log_stream, 
-                                     stderr=self.m_log_stream)
+        returncode = subprocess.call(
+            cmdline_prefix + [
+                self.m_clang_repository_url,
+                "clang"],
+            stdout=self.m_log_stream,
+            stderr=self.m_log_stream)
 
         if returncode != 0:
             raise BuildError(string="Couldn't checkout Clang")
+
     def Build(self):
         os.chdir(self.m_build_directory_path)
         os.chdir("lldb/llvm")
 
-        returncode = subprocess.call(["./configure", "--disable-optimized", "--enable-assertions", "--enable-targets=x86,x86_64,arm"], 
-                                     stdout=self.m_log_stream, 
+        returncode = subprocess.call(["./configure",
+                                      "--disable-optimized",
+                                      "--enable-assertions",
+                                      "--enable-targets=x86,x86_64,arm"],
+                                     stdout=self.m_log_stream,
                                      stderr=self.m_log_stream)
 
         if returncode != 0:
             raise BuildError(string="Couldn't configure LLVM/Clang")
 
-        returncode = subprocess.call(["make"], 
-                                     stdout=self.m_log_stream, 
+        returncode = subprocess.call(["make"],
+                                     stdout=self.m_log_stream,
                                      stderr=self.m_log_stream)
 
         if returncode != 0:
@@ -102,41 +126,61 @@ class LLDBBuildBot:
         os.chdir(self.m_build_directory_path)
         os.chdir("lldb")
 
-        returncode = subprocess.call(["xcodebuild", 
-                                      "-project", "lldb.xcodeproj", 
-                                      "-target", "lldb-tool", 
-                                      "-configuration", "Debug", 
+        returncode = subprocess.call(["xcodebuild",
+                                      "-project", "lldb.xcodeproj",
+                                      "-target", "lldb-tool",
+                                      "-configuration", "Debug",
                                       "-arch", "x86_64",
                                       "LLVM_CONFIGURATION=Debug+Asserts",
                                       "OBJROOT=build"],
-                                      stdout=self.m_log_stream,
-                                      stderr=self.m_log_stream)
+                                     stdout=self.m_log_stream,
+                                     stderr=self.m_log_stream)
 
         if returncode != 0:
             raise BuildError(string="Couldn't build LLDB")
+
     def Test(self):
         os.chdir(self.m_build_directory_path)
         os.chdir("lldb/test")
-        
-        returncode = subprocess.call(["./dotest.py", "-t"], 
-                                     stdout=self.m_log_stream, 
+
+        returncode = subprocess.call(["./dotest.py", "-t"],
+                                     stdout=self.m_log_stream,
                                      stderr=self.m_log_stream)
+
     def Takedown(self):
         os.chdir("/tmp")
         self.m_log_stream.close()
         shutil.rmtree(self.m_build_directory_path)
+
     def Run(self):
         self.Setup()
         self.Checkout()
         self.Build()
-        #self.Test()
+        # self.Test()
         self.Takedown()
 
+
 def GetArgParser():
-    parser = argparse.ArgumentParser(description="Try to build LLDB/LLVM/Clang and run the full test suite.")
-    parser.add_argument("--build-path", "-b", required=True, help="A (nonexistent) path to put temporary build products into", metavar="path")
-    parser.add_argument("--log-file", "-l", required=True, help="The name of a (nonexistent) log file", metavar="file")
-    parser.add_argument("--revision", "-r", required=False, help="The LLVM revision to use", metavar="N")
+    parser = argparse.ArgumentParser(
+        description="Try to build LLDB/LLVM/Clang and run the full test suite.")
+    parser.add_argument(
+        "--build-path",
+        "-b",
+        required=True,
+        help="A (nonexistent) path to put temporary build products into",
+        metavar="path")
+    parser.add_argument(
+        "--log-file",
+        "-l",
+        required=True,
+        help="The name of a (nonexistent) log file",
+        metavar="file")
+    parser.add_argument(
+        "--revision",
+        "-r",
+        required=False,
+        help="The LLVM revision to use",
+        metavar="N")
     return parser
 
 parser = GetArgParser()

Modified: lldb/trunk/scripts/finishSwigWrapperClasses.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/finishSwigWrapperClasses.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/finishSwigWrapperClasses.py (original)
+++ lldb/trunk/scripts/finishSwigWrapperClasses.py Tue Sep  6 15:57:50 2016
@@ -34,10 +34,12 @@ import utilsOsType      # Determine the
 import utilsDebug       # Debug Python scripts
 
 # Instantiations:
-gbDbgVerbose = False           # True = Turn on script function tracing, False = off.
+# True = Turn on script function tracing, False = off.
+gbDbgVerbose = False
 gbDbgFlag = False              # Global debug mode flag, set by input parameter
-                                # --dbgFlag. True = operate in debug mode.
-gbMakeFileFlag = False         # True = yes called from makefile system, False = not.
+# --dbgFlag. True = operate in debug mode.
+# True = yes called from makefile system, False = not.
+gbMakeFileFlag = False
 
 # User facing text:
 strMsgErrorNoMain = "Program called by another Python script not allowed"
@@ -84,7 +86,7 @@ Usage:\n\
     finishSwigWrapperClasses.py --srcRoot=ADirPath --targetDir=ADirPath\n\
     --cfgBldDir=ADirPath --prefix=ADirPath --lldbLibDir=ADirPath -m -d\n\
 \n\
-" #TAG_PROGRAM_HELP_INFO
+"  # TAG_PROGRAM_HELP_INFO
 
 #++---------------------------------------------------------------------------
 # Details:  Exit the program on success. Called on program successfully done
@@ -94,6 +96,8 @@ Usage:\n\
 # Returns:  None.
 # Throws:   None.
 #--
+
+
 def program_exit_success(vnResult, vMsg):
     strMsg = ""
 
@@ -111,6 +115,8 @@ def program_exit_success(vnResult, vMsg)
 # Returns:  None.
 # Throws:   None.
 #--
+
+
 def program_exit_on_failure(vnResult, vMsg):
     print(("%s%s (%d)" % (strExitMsgError, vMsg, vnResult)))
     sys.exit(vnResult)
@@ -124,6 +130,8 @@ def program_exit_on_failure(vnResult, vM
 # Returns:  None.
 # Throws:   None.
 #--
+
+
 def program_exit(vnResult, vMsg):
     if vnResult >= 0:
         program_exit_success(vnResult, vMsg)
@@ -136,6 +144,8 @@ def program_exit(vnResult, vMsg):
 # Returns:  None.
 # Throws:   None.
 #--
+
+
 def print_out_input_parameters(vDictArgs):
     for arg, val in list(vDictArgs.items()):
         strEqs = ""
@@ -153,24 +163,32 @@ def print_out_input_parameters(vDictArgs
 #           Dict    - Map of arguments names to argument values
 # Throws:   None.
 #--
+
+
 def validate_arguments(vArgv):
     dbg = utilsDebug.CDebugFnVerbose("validate_arguments()")
     strMsg = ""
     dictArgs = {}
     nResult = 0
-    strListArgs = "hdm" # Format "hiox:" = -h -i -o -x <arg>
-    listLongArgs = ["srcRoot=", "targetDir=", "cfgBldDir=", "prefix=", "cmakeBuildConfiguration=",
-                    "lldbLibDir=", "argsFile"]
-    dictArgReq = {  "-h": "o",          # o = optional, m = mandatory
-                    "-d": "o",
-                    "-m": "o",
-                    "--srcRoot": "m",
-                    "--targetDir": "m",
-                    "--cfgBldDir": "o",
-                    "--prefix": "o",
-                    "--cmakeBuildConfiguration": "o",
-                    "--lldbLibDir": "o",
-                    "--argsFile": "o" }
+    strListArgs = "hdm"  # Format "hiox:" = -h -i -o -x <arg>
+    listLongArgs = [
+        "srcRoot=",
+        "targetDir=",
+        "cfgBldDir=",
+        "prefix=",
+        "cmakeBuildConfiguration=",
+        "lldbLibDir=",
+        "argsFile"]
+    dictArgReq = {"-h": "o",          # o = optional, m = mandatory
+                  "-d": "o",
+                  "-m": "o",
+                  "--srcRoot": "m",
+                  "--targetDir": "m",
+                  "--cfgBldDir": "o",
+                  "--prefix": "o",
+                  "--cmakeBuildConfiguration": "o",
+                  "--lldbLibDir": "o",
+                  "--argsFile": "o"}
 
     # Check for mandatory parameters
     nResult, dictArgs, strMsg = utilsArgsParse.parse(vArgv, strListArgs,
@@ -196,18 +214,24 @@ def validate_arguments(vArgv):
 #           Str     - Error message.
 # Throws:   None.
 #--
+
+
 def run_post_process(vStrScriptLang, vstrFinishFileName, vDictArgs):
     dbg = utilsDebug.CDebugFnVerbose("run_post_process()")
     nResult = 0
     strStatusMsg = ""
     strScriptFile = vstrFinishFileName % vStrScriptLang
-    strScriptFileDir = os.path.normpath(os.path.join(vDictArgs["--srcRoot"], "scripts", vStrScriptLang))
+    strScriptFileDir = os.path.normpath(
+        os.path.join(
+            vDictArgs["--srcRoot"],
+            "scripts",
+            vStrScriptLang))
     strScriptFilePath = os.path.join(strScriptFileDir, strScriptFile)
 
     # Check for the existence of the script file
     strPath = os.path.normcase(strScriptFilePath)
     bOk = os.path.exists(strPath)
-    if bOk == False:
+    if not bOk:
         strDir = os.path.normcase(strScriptFileDir)
         strStatusMsg = strScriptNotFound % (strScriptFile, strDir)
         return (-9, strStatusMsg)
@@ -221,7 +245,7 @@ def run_post_process(vStrScriptLang, vst
     sys.path.append(strDir)
 
     # Execute the specific language script
-    dictArgs = vDictArgs # Remove any args not required before passing on
+    dictArgs = vDictArgs  # Remove any args not required before passing on
     strModuleName = strScriptFile[: strScriptFile.__len__() - 3]
     module = __import__(strModuleName)
     nResult, strStatusMsg = module.main(dictArgs)
@@ -242,17 +266,23 @@ def run_post_process(vStrScriptLang, vst
 #           Str     - Error message.
 # Throws:   None.
 #--
+
+
 def run_post_process_for_each_script_supported(vDictArgs):
-    dbg = utilsDebug.CDebugFnVerbose("run_post_process_for_each_script_supported()")
+    dbg = utilsDebug.CDebugFnVerbose(
+        "run_post_process_for_each_script_supported()")
     nResult = 0
     strStatusMsg = ""
-    strScriptDir = os.path.normpath(os.path.join(vDictArgs["--srcRoot"], "scripts"))
+    strScriptDir = os.path.normpath(
+        os.path.join(
+            vDictArgs["--srcRoot"],
+            "scripts"))
     strFinishFileName = "finishSwig%sLLDB.py"
 
     # Check for the existence of the scripts folder
     strScriptsDir = os.path.normcase(strScriptDir)
     bOk = os.path.exists(strScriptsDir)
-    if bOk == False:
+    if not bOk:
         return (-8, strScriptDirNotFound)
 
     # Look for any script language directories to build for
@@ -263,8 +293,8 @@ def run_post_process_for_each_script_sup
         # __pycache__ is a magic directory in Python 3 that holds .pyc files
         if scriptLang != "__pycache__" and scriptLang != "swig_bot_lib":
             dbg.dump_text("Executing language script for \'%s\'" % scriptLang)
-            nResult, strStatusMsg = run_post_process(scriptLang, strFinishFileName,
-                                                     vDictArgs)
+            nResult, strStatusMsg = run_post_process(
+                scriptLang, strFinishFileName, vDictArgs)
         if nResult < 0:
             break
 
@@ -283,6 +313,8 @@ def run_post_process_for_each_script_sup
 # Returns:  None
 # Throws:   None.
 #--
+
+
 def main(vArgv):
     dbg = utilsDebug.CDebugFnVerbose("main()")
     bOk = False
@@ -317,7 +349,7 @@ def main(vArgv):
 #-----------------------------------------------------------------------------
 #-----------------------------------------------------------------------------
 
-#TAG_PROGRAM_HELP_INFO
+# TAG_PROGRAM_HELP_INFO
 """ Details: Program main entry point.
 
     --------------------------------------------------------------------------

Modified: lldb/trunk/scripts/install_custom_python.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/install_custom_python.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/install_custom_python.py (original)
+++ lldb/trunk/scripts/install_custom_python.py Tue Sep  6 15:57:50 2016
@@ -26,24 +26,33 @@ import os
 import shutil
 import sys
 
+
 def copy_one_file(dest_dir, source_dir, filename):
     source_path = os.path.join(source_dir, filename)
     dest_path = os.path.join(dest_dir, filename)
     print 'Copying file %s ==> %s...' % (source_path, dest_path)
     shutil.copyfile(source_path, dest_path)
 
-def copy_named_files(dest_dir, source_dir, files, extensions, copy_debug_suffix_also):
+
+def copy_named_files(
+        dest_dir,
+        source_dir,
+        files,
+        extensions,
+        copy_debug_suffix_also):
     for (file, ext) in itertools.product(files, extensions):
         copy_one_file(dest_dir, source_dir, file + '.' + ext)
         if copy_debug_suffix_also:
             copy_one_file(dest_dir, source_dir, file + '_d.' + ext)
 
+
 def copy_subdirectory(dest_dir, source_dir, subdir):
     dest_dir = os.path.join(dest_dir, subdir)
     source_dir = os.path.join(source_dir, subdir)
     print 'Copying directory %s ==> %s...' % (source_dir, dest_dir)
     shutil.copytree(source_dir, dest_dir)
 
+
 def copy_distro(dest_dir, dest_subdir, source_dir, source_prefix):
     dest_dir = os.path.join(dest_dir, dest_subdir)
 
@@ -54,11 +63,19 @@ def copy_distro(dest_dir, dest_subdir, s
     if source_prefix:
         PCbuild_dir = os.path.join(PCbuild_dir, source_prefix)
     # First copy the files that go into the root of the new distribution. This
-    # includes the Python executables, python27(_d).dll, and relevant PDB files.
+    # includes the Python executables, python27(_d).dll, and relevant PDB
+    # files.
     print 'Copying Python executables...'
-    copy_named_files(dest_dir, PCbuild_dir, ['w9xpopen'], ['exe', 'pdb'], False)
-    copy_named_files(dest_dir, PCbuild_dir, ['python_d', 'pythonw_d'], ['exe'], False)
-    copy_named_files(dest_dir, PCbuild_dir, ['python', 'pythonw'], ['exe', 'pdb'], False)
+    copy_named_files(
+        dest_dir, PCbuild_dir, ['w9xpopen'], [
+            'exe', 'pdb'], False)
+    copy_named_files(
+        dest_dir, PCbuild_dir, [
+            'python_d', 'pythonw_d'], ['exe'], False)
+    copy_named_files(
+        dest_dir, PCbuild_dir, [
+            'python', 'pythonw'], [
+            'exe', 'pdb'], False)
     copy_named_files(dest_dir, PCbuild_dir, ['python27'], ['dll', 'pdb'], True)
 
     # Next copy everything in the Include directory.
@@ -83,8 +100,17 @@ def copy_distro(dest_dir, dest_subdir, s
     copy_subdirectory(tools_dest_dir, tools_source_dir, 'versioncheck')
     copy_subdirectory(tools_dest_dir, tools_source_dir, 'webchecker')
 
-    pyd_names = ['_ctypes', '_ctypes_test', '_elementtree', '_multiprocessing', '_socket',
-                 '_testcapi', 'pyexpat', 'select', 'unicodedata', 'winsound']
+    pyd_names = [
+        '_ctypes',
+        '_ctypes_test',
+        '_elementtree',
+        '_multiprocessing',
+        '_socket',
+        '_testcapi',
+        'pyexpat',
+        'select',
+        'unicodedata',
+        'winsound']
 
     # Copy builtin extension modules (pyd files)
     dlls_dir = os.path.join(dest_dir, 'DLLs')
@@ -100,11 +126,26 @@ def copy_distro(dest_dir, dest_subdir, s
     copy_named_files(libs_dir, PCbuild_dir, ['python27'], ['lib'], True)
 
 
-parser = argparse.ArgumentParser(description='Install a custom Python distribution')
-parser.add_argument('--source', required=True, help='The root of the source tree where Python is built.')
-parser.add_argument('--dest', required=True, help='The location to install the Python distributions.')
-parser.add_argument('--overwrite', default=False, action='store_true', help='If the destination directory already exists, destroys its contents first.')
-parser.add_argument('--silent', default=False, action='store_true', help='If --overwite was specified, suppress confirmation before deleting a directory tree.')
+parser = argparse.ArgumentParser(
+    description='Install a custom Python distribution')
+parser.add_argument(
+    '--source',
+    required=True,
+    help='The root of the source tree where Python is built.')
+parser.add_argument(
+    '--dest',
+    required=True,
+    help='The location to install the Python distributions.')
+parser.add_argument(
+    '--overwrite',
+    default=False,
+    action='store_true',
+    help='If the destination directory already exists, destroys its contents first.')
+parser.add_argument(
+    '--silent',
+    default=False,
+    action='store_true',
+    help='If --overwite was specified, suppress confirmation before deleting a directory tree.')
 
 args = parser.parse_args()
 

Modified: lldb/trunk/scripts/swig_bot.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/swig_bot.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/swig_bot.py (original)
+++ lldb/trunk/scripts/swig_bot.py Tue Sep  6 15:57:50 2016
@@ -18,6 +18,7 @@ import use_lldb_suite
 from swig_bot_lib import client
 from swig_bot_lib import server
 
+
 def process_args(args):
     parser = argparse.ArgumentParser(
         description='Run swig-bot client or server.')
@@ -54,11 +55,13 @@ def process_args(args):
 
     return options
 
+
 def run_client(options):
     logging.info("Running swig_bot in client mode")
     client.finalize_subparser_options(options)
     client.run(options)
 
+
 def run_server(options):
     logging.info("Running swig_bot in server mode")
     server.finalize_subparser_options(options)
@@ -68,7 +71,8 @@ if __name__ == "__main__":
     options = process_args(sys.argv[1:])
     try:
         if options.func is None:
-            logging.error("Unknown mode specified.  Expected client or server.")
+            logging.error(
+                "Unknown mode specified.  Expected client or server.")
             sys.exit(-1)
         else:
             options.func(options)

Modified: lldb/trunk/scripts/swig_bot_lib/client.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/swig_bot_lib/client.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/swig_bot_lib/client.py (original)
+++ lldb/trunk/scripts/swig_bot_lib/client.py Tue Sep  6 15:57:50 2016
@@ -30,6 +30,7 @@ from . import remote
 default_ip = "127.0.0.1"
 default_port = 8537
 
+
 def add_subparser_args(parser):
     """Returns options processed from the provided command line.
 
@@ -41,9 +42,11 @@ def add_subparser_args(parser):
     # searches for a copy of swig located on the physical machine.  If
     # used with 1 argument, the argument is the path to a swig executable.
     class FindLocalSwigAction(argparse.Action):
+
         def __init__(self, option_strings, dest, **kwargs):
             super(FindLocalSwigAction, self).__init__(
                 option_strings, dest, nargs='?', **kwargs)
+
         def __call__(self, parser, namespace, values, option_string=None):
             swig_exe = None
             if values is None:
@@ -58,18 +61,20 @@ def add_subparser_args(parser):
     # of the form `ip_address[:port]`.  If the port is unspecified, the
     # default port is used.
     class RemoteIpAction(argparse.Action):
+
         def __init__(self, option_strings, dest, **kwargs):
             super(RemoteIpAction, self).__init__(
                 option_strings, dest, nargs='?', **kwargs)
+
         def __call__(self, parser, namespace, values, option_string=None):
             ip_port = None
             if values is None:
                 ip_port = (default_ip, default_port)
             else:
                 result = values.split(':')
-                if len(result)==1:
+                if len(result) == 1:
                     ip_port = (result[0], default_port)
-                elif len(result)==2:
+                elif len(result) == 2:
                     ip_port = (result[0], int(result[1]))
                 else:
                     raise ValueError("Invalid connection string")
@@ -108,6 +113,7 @@ def add_subparser_args(parser):
         action="append",
         help="Specifies the language to generate bindings for")
 
+
 def finalize_subparser_options(options):
     if options.languages is None:
         options.languages = ['python']
@@ -118,6 +124,7 @@ def finalize_subparser_options(options):
 
     return options
 
+
 def establish_remote_connection(ip_port):
     logging.debug("Creating socket...")
     s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@@ -127,6 +134,7 @@ def establish_remote_connection(ip_port)
     logging.info("Connection established...")
     return s
 
+
 def transmit_request(connection, packed_input):
     logging.info("Sending {} bytes of compressed data."
                  .format(len(packed_input)))
@@ -138,27 +146,28 @@ def transmit_request(connection, packed_
     response = sockutil.recvall(connection, response_len)
     return response
 
+
 def handle_response(options, connection, response):
     logging.debug("Received {} byte response.".format(len(response)))
     logging.debug("Creating output directory {}"
-                    .format(options.target_dir))
+                  .format(options.target_dir))
     os.makedirs(options.target_dir, exist_ok=True)
 
     logging.info("Unpacking response archive into {}"
-                    .format(options.target_dir))
+                 .format(options.target_dir))
     local.unpack_archive(options.target_dir, response)
     response_file_path = os.path.normpath(
         os.path.join(options.target_dir, "swig_output.json"))
     if not os.path.isfile(response_file_path):
         logging.error("Response file '{}' does not exist."
-                        .format(response_file_path))
+                      .format(response_file_path))
         return
     try:
         response = remote.deserialize_response_status(
             io.open(response_file_path))
         if response[0] != 0:
             logging.error("An error occurred during generation.  Status={}"
-                            .format(response[0]))
+                          .format(response[0]))
             logging.error(response[1])
         else:
             logging.info("SWIG generation successful.")
@@ -167,6 +176,7 @@ def handle_response(options, connection,
     finally:
         os.unlink(response_file_path)
 
+
 def run(options):
     if options.remote is None:
         logging.info("swig bot client using local swig installation at '{}'"
@@ -193,7 +203,8 @@ def run(options):
                       ("scripts/Python", ".swig"),
                       ("scripts/interface", ".i")]
             zip_data = io.BytesIO()
-            packed_input = local.pack_archive(zip_data, options.src_root, inputs)
+            packed_input = local.pack_archive(
+                zip_data, options.src_root, inputs)
             logging.info("(null) -> config.json")
             packed_input.writestr("config.json", config)
             packed_input.close()
@@ -202,4 +213,4 @@ def run(options):
             handle_response(options, connection, response)
         finally:
             if connection is not None:
-                connection.close()
\ No newline at end of file
+                connection.close()

Modified: lldb/trunk/scripts/swig_bot_lib/local.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/swig_bot_lib/local.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/swig_bot_lib/local.py (original)
+++ lldb/trunk/scripts/swig_bot_lib/local.py Tue Sep  6 15:57:50 2016
@@ -26,12 +26,14 @@ import use_lldb_suite
 # Package imports
 from lldbsuite.support import fs
 
+
 class LocalConfig(object):
     src_root = None
     target_dir = None
     languages = None
     swig_executable = None
 
+
 def pack_archive(bytes_io, src_root, filters):
     logging.info("Creating input file package...")
     zip_file = None
@@ -53,9 +55,9 @@ def pack_archive(bytes_io, src_root, fil
             candidates = [os.path.normpath(os.path.join(full_path, f))
                           for f in os.listdir(full_path)]
             actual = filter(
-                lambda f : os.path.isfile(f) and os.path.splitext(f)[1] == ext,
+                lambda f: os.path.isfile(f) and os.path.splitext(f)[1] == ext,
                 candidates)
-            return (subfolder, map(lambda f : os.path.basename(f), actual))
+            return (subfolder, map(lambda f: os.path.basename(f), actual))
         archive_entries = map(filter_func, filters)
     else:
         for (root, dirs, files) in os.walk(src_root):
@@ -77,6 +79,7 @@ def pack_archive(bytes_io, src_root, fil
 
     return zip_file
 
+
 def unpack_archive(folder, archive_bytes):
     zip_data = io.BytesIO(archive_bytes)
     logging.debug("Opening zip archive...")
@@ -84,6 +87,7 @@ def unpack_archive(folder, archive_bytes
     zip_file.extractall(folder)
     zip_file.close()
 
+
 def generate(options):
     include_folder = os.path.join(options.src_root, "include")
     in_file = os.path.join(options.src_root, "scripts", "lldb.swig")
@@ -128,4 +132,4 @@ def generate(options):
             logging.error("An error occurred executing swig.  returncode={}"
                           .format(e.returncode))
             logging.error(e.output)
-            return (e.returncode, e.output)
\ No newline at end of file
+            return (e.returncode, e.output)

Modified: lldb/trunk/scripts/swig_bot_lib/remote.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/swig_bot_lib/remote.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/swig_bot_lib/remote.py (original)
+++ lldb/trunk/scripts/swig_bot_lib/remote.py Tue Sep  6 15:57:50 2016
@@ -20,19 +20,23 @@ import sys
 # LLDB modules
 import use_lldb_suite
 
+
 def generate_config(languages):
     config = {"languages": languages}
     return json.dumps(config)
 
+
 def parse_config(json_reader):
     json_data = json_reader.read()
     options_dict = json.loads(json_data)
     return options_dict
 
+
 def serialize_response_status(status):
     status = {"retcode": status[0], "output": status[1]}
     return json.dumps(status)
 
+
 def deserialize_response_status(json_reader):
     json_data = json_reader.read()
     response_dict = json.loads(json_data)

Modified: lldb/trunk/scripts/swig_bot_lib/server.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/swig_bot_lib/server.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/swig_bot_lib/server.py (original)
+++ lldb/trunk/scripts/swig_bot_lib/server.py Tue Sep  6 15:57:50 2016
@@ -33,6 +33,7 @@ from . import remote
 
 default_port = 8537
 
+
 def add_subparser_args(parser):
     parser.add_argument(
         "--port",
@@ -46,9 +47,11 @@ def add_subparser_args(parser):
         default=fs.find_executable("swig"),
         dest="swig_executable")
 
+
 def finalize_subparser_options(options):
     pass
 
+
 def initialize_listening_socket(options):
     logging.debug("Creating socket...")
     s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@@ -60,6 +63,7 @@ def initialize_listening_socket(options)
     s.listen()
     return s
 
+
 def accept_once(sock, options):
     logging.debug("Waiting for connection...")
     while True:
@@ -122,6 +126,7 @@ def accept_once(sock, options):
                               .format(pack_location))
                 shutil.rmtree(pack_location)
 
+
 def accept_loop(sock, options):
     while True:
         try:
@@ -131,6 +136,7 @@ def accept_loop(sock, options):
             logging.error("An error occurred while processing the connection.")
             logging.error(error)
 
+
 def run(options):
     print(options)
     sock = initialize_listening_socket(options)

Modified: lldb/trunk/scripts/use_lldb_suite.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/use_lldb_suite.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/use_lldb_suite.py (original)
+++ lldb/trunk/scripts/use_lldb_suite.py Tue Sep  6 15:57:50 2016
@@ -2,6 +2,7 @@ import inspect
 import os
 import sys
 
+
 def find_lldb_root():
     lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe()))
     while True:

Modified: lldb/trunk/scripts/utilsArgsParse.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/utilsArgsParse.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/utilsArgsParse.py (original)
+++ lldb/trunk/scripts/utilsArgsParse.py Tue Sep  6 15:57:50 2016
@@ -17,7 +17,7 @@
 """
 
 # Python modules:
-import getopt # Parse command line arguments
+import getopt  # Parse command line arguments
 
 # Third party modules:
 
@@ -54,6 +54,8 @@ strMsgArgFileNotImplemented = "Sorry the
 #          Str - Error message.
 # Throws:  None.
 #--
+
+
 def parse(vArgv, vstrListArgs, vListLongArgs, vDictArgReq, vstrHelpInfo):
     dictArgs = {}
     dictDummy = {}
@@ -127,8 +129,8 @@ def parse(vArgv, vstrListArgs, vListLong
         return (-1, dictDummy, strMsg)
 
     # Debug only
-    #print countMandatoryOpts
-    #print countMandatory
+    # print countMandatoryOpts
+    # print countMandatory
 
     # Do we have the exact number of mandatory arguments
     if (countMandatoryOpts > 0) and (countMandatory != countMandatoryOpts):

Modified: lldb/trunk/scripts/utilsDebug.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/utilsDebug.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/utilsDebug.py (original)
+++ lldb/trunk/scripts/utilsDebug.py Tue Sep  6 15:57:50 2016
@@ -28,9 +28,11 @@ import sys
 # Authors: Illya Rudkin 28/11/2013.
 # Changes: None.
 #--
+
+
 class CDebugFnVerbose(object):
     # Public static properties:
-    bVerboseOn = False # True = turn on function tracing, False = turn off.
+    bVerboseOn = False  # True = turn on function tracing, False = turn off.
 
     # Public:
     #++------------------------------------------------------------------------
@@ -51,10 +53,13 @@ class CDebugFnVerbose(object):
     # Throws:  None.
     #--
     def dump_object(self, vstrText, vObject):
-        if CDebugFnVerbose.bVerboseOn == False:
+        if not CDebugFnVerbose.bVerboseOn:
             return
-        sys.stdout.write("%d%s> Dp: %s" % (CDebugFnVerbose.__nLevel, self.__get_dots(),
-                                           vstrText))
+        sys.stdout.write(
+            "%d%s> Dp: %s" %
+            (CDebugFnVerbose.__nLevel,
+             self.__get_dots(),
+             vstrText))
         print(vObject)
 
     #++------------------------------------------------------------------------
@@ -65,7 +70,7 @@ class CDebugFnVerbose(object):
     # Throws:  None.
     #--
     def dump_text(self, vstrText):
-        if CDebugFnVerbose.bVerboseOn == False:
+        if not CDebugFnVerbose.bVerboseOn:
             return
         print(("%d%s> Dp: %s" % (CDebugFnVerbose.__nLevel, self.__get_dots(),
                                  vstrText)))
@@ -94,8 +99,8 @@ class CDebugFnVerbose(object):
     #--
     def __indent_back(self):
         if CDebugFnVerbose.bVerboseOn:
-            print(("%d%s< fn: %s" % (CDebugFnVerbose.__nLevel, self.__get_dots(),
-                                     self.__strFnName)))
+            print(("%d%s< fn: %s" % (CDebugFnVerbose.__nLevel,
+                                     self.__get_dots(), self.__strFnName)))
         CDebugFnVerbose.__nLevel -= 1
 
     #++------------------------------------------------------------------------
@@ -110,11 +115,11 @@ class CDebugFnVerbose(object):
         CDebugFnVerbose.__nLevel += 1
         self.__strFnName = vstrFnName
         if CDebugFnVerbose.bVerboseOn:
-            print(("%d%s> fn: %s" % (CDebugFnVerbose.__nLevel, self.__get_dots(),
-                                     self.__strFnName)))
+            print(("%d%s> fn: %s" % (CDebugFnVerbose.__nLevel,
+                                     self.__get_dots(), self.__strFnName)))
 
     # Private statics attributes:
-    __nLevel = 0 # Indentation level counter
+    __nLevel = 0  # Indentation level counter
 
     # Private attributes:
     __strFnName = ""

Modified: lldb/trunk/scripts/utilsOsType.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/utilsOsType.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/utilsOsType.py (original)
+++ lldb/trunk/scripts/utilsOsType.py Tue Sep  6 15:57:50 2016
@@ -28,6 +28,7 @@ import sys      # Provide system informa
 #--
 if sys.version_info.major >= 3:
     from enum import Enum
+
     class EnumOsType(Enum):
         Unknown = 0
         Darwin = 1
@@ -43,13 +44,15 @@ else:
                   "Linux",
                   "NetBSD",
                   "Windows"]
+
         class __metaclass__(type):
-#++---------------------------------------------------------------------------
-# Details:  Fn acts as an enumeration.
-# Args:     vName - (R) Enumeration to match.
-# Returns:  Int - Matching enumeration/index.
-# Throws:   None.
-#--
+            #++----------------------------------------------------------------
+            # Details:  Fn acts as an enumeration.
+            # Args:     vName - (R) Enumeration to match.
+            # Returns:  Int - Matching enumeration/index.
+            # Throws:   None.
+            #--
+
             def __getattr__(cls, vName):
                 return cls.values.index(vName)
 
@@ -72,6 +75,8 @@ else:
 # Returns:  EnumOsType - The OS type being used ATM.
 # Throws:   None.
 #--
+
+
 def determine_os_type():
     eOSType = EnumOsType.Unknown
 

Modified: lldb/trunk/scripts/verify_api.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/verify_api.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/scripts/verify_api.py (original)
+++ lldb/trunk/scripts/verify_api.py Tue Sep  6 15:57:50 2016
@@ -7,8 +7,10 @@ import os.path
 import re
 import sys
 
-def extract_exe_symbol_names (arch, exe_path, match_str):
-    command = 'dsymutil --arch %s -s "%s" | grep "%s" | colrm 1 69' % (arch, exe_path, match_str)
+
+def extract_exe_symbol_names(arch, exe_path, match_str):
+    command = 'dsymutil --arch %s -s "%s" | grep "%s" | colrm 1 69' % (
+        arch, exe_path, match_str)
     (command_exit_status, command_output) = commands.getstatusoutput(command)
     if command_exit_status == 0:
         if command_output:
@@ -19,27 +21,55 @@ def extract_exe_symbol_names (arch, exe_
         print 'error: command failed with exit status %i\n    command: %s' % (command_exit_status, command)
     return list()
 
+
 def verify_api(all_args):
     '''Verify the API in the specified library is valid given one or more binaries.'''
     usage = "usage: verify_api --library <path> [ --library <path> ...] executable1 [executable2 ...]"
-    description='''Verify the API in the specified library is valid given one or more binaries.
-    
+    description = '''Verify the API in the specified library is valid given one or more binaries.
+
     Example:
-    
+
         verify_api.py --library ~/Documents/src/lldb/build/Debug/LLDB.framework/LLDB --arch x86_64 /Applications/Xcode.app/Contents/PlugIns/DebuggerLLDB.ideplugin/Contents/MacOS/DebuggerLLDB --api-regex lldb
     '''
-    parser = optparse.OptionParser(description=description, prog='verify_api',usage=usage)
-    parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='display verbose debug info', default=False)
-    parser.add_option('-a', '--arch', type='string', action='append', dest='archs', help='architecure to use when checking the api')
-    parser.add_option('-r', '--api-regex', type='string', dest='api_regex_str', help='Exclude any undefined symbols that do not match this regular expression when searching for missing APIs.')
-    parser.add_option('-l', '--library', type='string', action='append', dest='libraries', help='Specify one or more libraries that will contain all needed APIs for the executables.')
+    parser = optparse.OptionParser(
+        description=description,
+        prog='verify_api',
+        usage=usage)
+    parser.add_option(
+        '-v',
+        '--verbose',
+        action='store_true',
+        dest='verbose',
+        help='display verbose debug info',
+        default=False)
+    parser.add_option(
+        '-a',
+        '--arch',
+        type='string',
+        action='append',
+        dest='archs',
+        help='architecure to use when checking the api')
+    parser.add_option(
+        '-r',
+        '--api-regex',
+        type='string',
+        dest='api_regex_str',
+        help='Exclude any undefined symbols that do not match this regular expression when searching for missing APIs.')
+    parser.add_option(
+        '-l',
+        '--library',
+        type='string',
+        action='append',
+        dest='libraries',
+        help='Specify one or more libraries that will contain all needed APIs for the executables.')
     (options, args) = parser.parse_args(all_args)
-    
+
     api_external_symbols = list()
     if options.archs:
         for arch in options.archs:
             for library in options.libraries:
-                external_symbols = extract_exe_symbol_names(arch, library, "(     SECT EXT)");
+                external_symbols = extract_exe_symbol_names(
+                    arch, library, "(     SECT EXT)")
                 if external_symbols:
                     for external_symbol in external_symbols:
                         api_external_symbols.append(external_symbol)
@@ -52,16 +82,17 @@ def verify_api(all_args):
         print "API symbols:"
         for (i, external_symbol) in enumerate(api_external_symbols):
             print "[%u] %s" % (i, external_symbol)
-    
+
     api_regex = None
     if options.api_regex_str:
         api_regex = re.compile(options.api_regex_str)
-    
-    for arch in options.archs:        
+
+    for arch in options.archs:
         for exe_path in args:
             print 'Verifying (%s) "%s"...' % (arch, exe_path)
             exe_errors = 0
-            undefined_symbols = extract_exe_symbol_names(arch, exe_path, "(     UNDF EXT)");
+            undefined_symbols = extract_exe_symbol_names(
+                arch, exe_path, "(     UNDF EXT)")
             for undefined_symbol in undefined_symbols:
                 if api_regex:
                     match = api_regex.search(undefined_symbol)
@@ -79,6 +110,6 @@ def verify_api(all_args):
                 print 'error: missing %u API symbols from %s' % (exe_errors, options.libraries)
             else:
                 print 'success'
-        
+
 if __name__ == '__main__':
-    verify_api(sys.argv[1:])
\ No newline at end of file
+    verify_api(sys.argv[1:])

Modified: lldb/trunk/source/API/SBAddress.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBAddress.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBAddress.cpp (original)
+++ lldb/trunk/source/API/SBAddress.cpp Tue Sep  6 15:57:50 2016
@@ -18,312 +18,227 @@
 #include "lldb/Symbol/LineEntry.h"
 #include "lldb/Target/Target.h"
 
-
 using namespace lldb;
 using namespace lldb_private;
 
+SBAddress::SBAddress() : m_opaque_ap(new Address()) {}
 
-SBAddress::SBAddress () :
-    m_opaque_ap (new Address())
-{
+SBAddress::SBAddress(const Address *lldb_object_ptr)
+    : m_opaque_ap(new Address()) {
+  if (lldb_object_ptr)
+    ref() = *lldb_object_ptr;
 }
 
-SBAddress::SBAddress (const Address *lldb_object_ptr) :
-    m_opaque_ap (new Address())
-{
-    if (lldb_object_ptr)
-        ref() = *lldb_object_ptr;
+SBAddress::SBAddress(const SBAddress &rhs) : m_opaque_ap(new Address()) {
+  if (rhs.IsValid())
+    ref() = rhs.ref();
 }
 
-SBAddress::SBAddress (const SBAddress &rhs) :
-    m_opaque_ap (new Address())
-{
-    if (rhs.IsValid())
-        ref() = rhs.ref();
+SBAddress::SBAddress(lldb::SBSection section, lldb::addr_t offset)
+    : m_opaque_ap(new Address(section.GetSP(), offset)) {}
+
+// Create an address by resolving a load address using the supplied target
+SBAddress::SBAddress(lldb::addr_t load_addr, lldb::SBTarget &target)
+    : m_opaque_ap(new Address()) {
+  SetLoadAddress(load_addr, target);
 }
 
+SBAddress::~SBAddress() {}
 
-SBAddress::SBAddress (lldb::SBSection section, lldb::addr_t offset) :
-    m_opaque_ap(new Address (section.GetSP(), offset))
-{
+const SBAddress &SBAddress::operator=(const SBAddress &rhs) {
+  if (this != &rhs) {
+    if (rhs.IsValid())
+      ref() = rhs.ref();
+    else
+      m_opaque_ap.reset(new Address());
+  }
+  return *this;
 }
 
-// Create an address by resolving a load address using the supplied target
-SBAddress::SBAddress (lldb::addr_t load_addr, lldb::SBTarget &target) :
-    m_opaque_ap(new Address())
-{    
-    SetLoadAddress (load_addr, target);
+bool SBAddress::IsValid() const {
+  return m_opaque_ap.get() != NULL && m_opaque_ap->IsValid();
 }
 
+void SBAddress::Clear() { m_opaque_ap.reset(new Address()); }
 
+void SBAddress::SetAddress(lldb::SBSection section, lldb::addr_t offset) {
+  Address &addr = ref();
+  addr.SetSection(section.GetSP());
+  addr.SetOffset(offset);
+}
 
-SBAddress::~SBAddress ()
-{
+void SBAddress::SetAddress(const Address *lldb_object_ptr) {
+  if (lldb_object_ptr)
+    ref() = *lldb_object_ptr;
+  else
+    m_opaque_ap.reset(new Address());
 }
 
-const SBAddress &
-SBAddress::operator = (const SBAddress &rhs)
-{
-    if (this != &rhs)
-    {
-        if (rhs.IsValid())
-            ref() = rhs.ref();
-        else
-            m_opaque_ap.reset (new Address());
+lldb::addr_t SBAddress::GetFileAddress() const {
+  if (m_opaque_ap->IsValid())
+    return m_opaque_ap->GetFileAddress();
+  else
+    return LLDB_INVALID_ADDRESS;
+}
+
+lldb::addr_t SBAddress::GetLoadAddress(const SBTarget &target) const {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  lldb::addr_t addr = LLDB_INVALID_ADDRESS;
+  TargetSP target_sp(target.GetSP());
+  if (target_sp) {
+    if (m_opaque_ap->IsValid()) {
+      std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
+      addr = m_opaque_ap->GetLoadAddress(target_sp.get());
     }
-    return *this;
+  }
+
+  if (log) {
+    if (addr == LLDB_INVALID_ADDRESS)
+      log->Printf(
+          "SBAddress::GetLoadAddress (SBTarget(%p)) => LLDB_INVALID_ADDRESS",
+          static_cast<void *>(target_sp.get()));
+    else
+      log->Printf("SBAddress::GetLoadAddress (SBTarget(%p)) => 0x%" PRIx64,
+                  static_cast<void *>(target_sp.get()), addr);
+  }
+
+  return addr;
 }
 
-bool
-SBAddress::IsValid () const
-{
-    return m_opaque_ap.get() != NULL && m_opaque_ap->IsValid();
+void SBAddress::SetLoadAddress(lldb::addr_t load_addr, lldb::SBTarget &target) {
+  // Create the address object if we don't already have one
+  ref();
+  if (target.IsValid())
+    *this = target.ResolveLoadAddress(load_addr);
+  else
+    m_opaque_ap->Clear();
+
+  // Check if we weren't were able to resolve a section offset address.
+  // If we weren't it is ok, the load address might be a location on the
+  // stack or heap, so we should just have an address with no section and
+  // a valid offset
+  if (!m_opaque_ap->IsValid())
+    m_opaque_ap->SetOffset(load_addr);
 }
 
-void
-SBAddress::Clear ()
-{
-    m_opaque_ap.reset (new Address());
+bool SBAddress::OffsetAddress(addr_t offset) {
+  if (m_opaque_ap->IsValid()) {
+    addr_t addr_offset = m_opaque_ap->GetOffset();
+    if (addr_offset != LLDB_INVALID_ADDRESS) {
+      m_opaque_ap->SetOffset(addr_offset + offset);
+      return true;
+    }
+  }
+  return false;
 }
 
-void
-SBAddress::SetAddress (lldb::SBSection section, lldb::addr_t offset)
-{
-    Address &addr = ref();
-    addr.SetSection (section.GetSP());
-    addr.SetOffset (offset);
+lldb::SBSection SBAddress::GetSection() {
+  lldb::SBSection sb_section;
+  if (m_opaque_ap->IsValid())
+    sb_section.SetSP(m_opaque_ap->GetSection());
+  return sb_section;
 }
 
+lldb::addr_t SBAddress::GetOffset() {
+  if (m_opaque_ap->IsValid())
+    return m_opaque_ap->GetOffset();
+  return 0;
+}
 
-void
-SBAddress::SetAddress (const Address *lldb_object_ptr)
-{
-    if (lldb_object_ptr)
-        ref() =  *lldb_object_ptr;
-    else
-        m_opaque_ap.reset (new Address());
+Address *SBAddress::operator->() { return m_opaque_ap.get(); }
+
+const Address *SBAddress::operator->() const { return m_opaque_ap.get(); }
+
+Address &SBAddress::ref() {
+  if (m_opaque_ap.get() == NULL)
+    m_opaque_ap.reset(new Address());
+  return *m_opaque_ap;
 }
 
-lldb::addr_t
-SBAddress::GetFileAddress () const
-{
-    if (m_opaque_ap->IsValid())
-        return m_opaque_ap->GetFileAddress();
-    else
-        return LLDB_INVALID_ADDRESS;
+const Address &SBAddress::ref() const {
+  // This object should already have checked with "IsValid()"
+  // prior to calling this function. In case you didn't we will assert
+  // and die to let you know.
+  assert(m_opaque_ap.get());
+  return *m_opaque_ap;
 }
 
-lldb::addr_t
-SBAddress::GetLoadAddress (const SBTarget &target) const
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    lldb::addr_t addr = LLDB_INVALID_ADDRESS;
-    TargetSP target_sp (target.GetSP());
-    if (target_sp)
-    {
-        if (m_opaque_ap->IsValid())
-        {
-            std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
-            addr = m_opaque_ap->GetLoadAddress (target_sp.get());
-        }
-    }
+Address *SBAddress::get() { return m_opaque_ap.get(); }
 
-    if (log)
-    {
-        if (addr == LLDB_INVALID_ADDRESS)
-            log->Printf ("SBAddress::GetLoadAddress (SBTarget(%p)) => LLDB_INVALID_ADDRESS",
-                         static_cast<void*>(target_sp.get()));
-        else
-            log->Printf ("SBAddress::GetLoadAddress (SBTarget(%p)) => 0x%" PRIx64,
-                         static_cast<void*>(target_sp.get()), addr);
-    }
+bool SBAddress::GetDescription(SBStream &description) {
+  // Call "ref()" on the stream to make sure it creates a backing stream in
+  // case there isn't one already...
+  Stream &strm = description.ref();
+  if (m_opaque_ap->IsValid()) {
+    m_opaque_ap->Dump(&strm, NULL, Address::DumpStyleResolvedDescription,
+                      Address::DumpStyleModuleWithFileAddress, 4);
+    StreamString sstrm;
+    //        m_opaque_ap->Dump (&sstrm, NULL,
+    //        Address::DumpStyleResolvedDescription, Address::DumpStyleInvalid,
+    //        4);
+    //        if (sstrm.GetData())
+    //            strm.Printf (" (%s)", sstrm.GetData());
+  } else
+    strm.PutCString("No value");
 
-    return addr;
+  return true;
 }
 
-void
-SBAddress::SetLoadAddress (lldb::addr_t load_addr, lldb::SBTarget &target)
-{
-    // Create the address object if we don't already have one
-    ref();
-    if (target.IsValid())
-        *this = target.ResolveLoadAddress(load_addr);
-    else
-        m_opaque_ap->Clear();
+SBModule SBAddress::GetModule() {
+  SBModule sb_module;
+  if (m_opaque_ap->IsValid())
+    sb_module.SetSP(m_opaque_ap->GetModule());
+  return sb_module;
+}
 
-    // Check if we weren't were able to resolve a section offset address.
-    // If we weren't it is ok, the load address might be a location on the
-    // stack or heap, so we should just have an address with no section and
-    // a valid offset
-    if (!m_opaque_ap->IsValid())
-        m_opaque_ap->SetOffset(load_addr);
-}
-
-bool
-SBAddress::OffsetAddress (addr_t offset)
-{
-    if (m_opaque_ap->IsValid())
-    {
-        addr_t addr_offset = m_opaque_ap->GetOffset();
-        if (addr_offset != LLDB_INVALID_ADDRESS)
-        {
-            m_opaque_ap->SetOffset(addr_offset + offset);
-            return true;
-        }
-    }
-    return false;
+SBSymbolContext SBAddress::GetSymbolContext(uint32_t resolve_scope) {
+  SBSymbolContext sb_sc;
+  if (m_opaque_ap->IsValid())
+    m_opaque_ap->CalculateSymbolContext(&sb_sc.ref(), resolve_scope);
+  return sb_sc;
 }
 
-lldb::SBSection
-SBAddress::GetSection ()
-{
-    lldb::SBSection sb_section;
-    if (m_opaque_ap->IsValid())
-        sb_section.SetSP (m_opaque_ap->GetSection());
-    return sb_section;
-}
-
-lldb::addr_t
-SBAddress::GetOffset ()
-{
-    if (m_opaque_ap->IsValid())
-        return m_opaque_ap->GetOffset();
-    return 0;
-}
-
-Address *
-SBAddress::operator->()
-{
-    return m_opaque_ap.get();
-}
-
-const Address *
-SBAddress::operator->() const
-{
-    return m_opaque_ap.get();
-}
-
-Address &
-SBAddress::ref ()
-{
-    if (m_opaque_ap.get() == NULL)
-        m_opaque_ap.reset (new Address());
-    return *m_opaque_ap;
-}
-
-const Address &
-SBAddress::ref () const
-{
-    // This object should already have checked with "IsValid()" 
-    // prior to calling this function. In case you didn't we will assert
-    // and die to let you know.
-    assert (m_opaque_ap.get());
-    return *m_opaque_ap;
-}
-
-Address *
-SBAddress::get ()
-{
-    return m_opaque_ap.get();
-}
-
-bool
-SBAddress::GetDescription (SBStream &description)
-{
-    // Call "ref()" on the stream to make sure it creates a backing stream in
-    // case there isn't one already...
-    Stream &strm = description.ref();
-    if (m_opaque_ap->IsValid())
-    {
-        m_opaque_ap->Dump (&strm,
-                           NULL,
-                           Address::DumpStyleResolvedDescription,
-                           Address::DumpStyleModuleWithFileAddress,
-                           4);
-        StreamString sstrm;
-//        m_opaque_ap->Dump (&sstrm, NULL, Address::DumpStyleResolvedDescription, Address::DumpStyleInvalid, 4);
-//        if (sstrm.GetData())
-//            strm.Printf (" (%s)", sstrm.GetData());
-    }
-    else
-        strm.PutCString ("No value");
+SBCompileUnit SBAddress::GetCompileUnit() {
+  SBCompileUnit sb_comp_unit;
+  if (m_opaque_ap->IsValid())
+    sb_comp_unit.reset(m_opaque_ap->CalculateSymbolContextCompileUnit());
+  return sb_comp_unit;
+}
 
-    return true;
+SBFunction SBAddress::GetFunction() {
+  SBFunction sb_function;
+  if (m_opaque_ap->IsValid())
+    sb_function.reset(m_opaque_ap->CalculateSymbolContextFunction());
+  return sb_function;
 }
 
-SBModule
-SBAddress::GetModule ()
-{
-    SBModule sb_module;
-    if (m_opaque_ap->IsValid())
-        sb_module.SetSP (m_opaque_ap->GetModule());
-    return sb_module;
-}
-
-SBSymbolContext
-SBAddress::GetSymbolContext (uint32_t resolve_scope)
-{
-    SBSymbolContext sb_sc;
-    if (m_opaque_ap->IsValid())
-        m_opaque_ap->CalculateSymbolContext (&sb_sc.ref(), resolve_scope);
-    return sb_sc;
-}
-
-SBCompileUnit
-SBAddress::GetCompileUnit ()
-{
-    SBCompileUnit sb_comp_unit;
-    if (m_opaque_ap->IsValid())
-        sb_comp_unit.reset(m_opaque_ap->CalculateSymbolContextCompileUnit());
-    return sb_comp_unit;
-}
-
-SBFunction
-SBAddress::GetFunction ()
-{
-    SBFunction sb_function;
-    if (m_opaque_ap->IsValid())
-        sb_function.reset(m_opaque_ap->CalculateSymbolContextFunction());
-    return sb_function;
-}
-
-SBBlock
-SBAddress::GetBlock ()
-{
-    SBBlock sb_block;
-    if (m_opaque_ap->IsValid())
-        sb_block.SetPtr(m_opaque_ap->CalculateSymbolContextBlock());
-    return sb_block;
-}
-
-SBSymbol
-SBAddress::GetSymbol ()
-{
-    SBSymbol sb_symbol;
-    if (m_opaque_ap->IsValid())
-        sb_symbol.reset(m_opaque_ap->CalculateSymbolContextSymbol());
-    return sb_symbol;
-}
-
-SBLineEntry
-SBAddress::GetLineEntry ()
-{
-    SBLineEntry sb_line_entry;
-    if (m_opaque_ap->IsValid())
-    {
-        LineEntry line_entry;
-        if (m_opaque_ap->CalculateSymbolContextLineEntry (line_entry))
-            sb_line_entry.SetLineEntry (line_entry);
-    }
-    return sb_line_entry;
+SBBlock SBAddress::GetBlock() {
+  SBBlock sb_block;
+  if (m_opaque_ap->IsValid())
+    sb_block.SetPtr(m_opaque_ap->CalculateSymbolContextBlock());
+  return sb_block;
+}
+
+SBSymbol SBAddress::GetSymbol() {
+  SBSymbol sb_symbol;
+  if (m_opaque_ap->IsValid())
+    sb_symbol.reset(m_opaque_ap->CalculateSymbolContextSymbol());
+  return sb_symbol;
 }
 
-AddressClass
-SBAddress::GetAddressClass ()
-{
-    if (m_opaque_ap->IsValid())
-        return m_opaque_ap->GetAddressClass();
-    return eAddressClassInvalid;
+SBLineEntry SBAddress::GetLineEntry() {
+  SBLineEntry sb_line_entry;
+  if (m_opaque_ap->IsValid()) {
+    LineEntry line_entry;
+    if (m_opaque_ap->CalculateSymbolContextLineEntry(line_entry))
+      sb_line_entry.SetLineEntry(line_entry);
+  }
+  return sb_line_entry;
 }
 
+AddressClass SBAddress::GetAddressClass() {
+  if (m_opaque_ap->IsValid())
+    return m_opaque_ap->GetAddressClass();
+  return eAddressClassInvalid;
+}

Modified: lldb/trunk/source/API/SBAttachInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBAttachInfo.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBAttachInfo.cpp (original)
+++ lldb/trunk/source/API/SBAttachInfo.cpp Tue Sep  6 15:57:50 2016
@@ -16,243 +16,152 @@
 using namespace lldb;
 using namespace lldb_private;
 
+SBAttachInfo::SBAttachInfo() : m_opaque_sp(new ProcessAttachInfo()) {}
 
-SBAttachInfo::SBAttachInfo () :
-    m_opaque_sp (new ProcessAttachInfo())
-{
+SBAttachInfo::SBAttachInfo(lldb::pid_t pid)
+    : m_opaque_sp(new ProcessAttachInfo()) {
+  m_opaque_sp->SetProcessID(pid);
 }
 
-SBAttachInfo::SBAttachInfo (lldb::pid_t pid) :
-    m_opaque_sp (new ProcessAttachInfo())
-{
-    m_opaque_sp->SetProcessID (pid);
+SBAttachInfo::SBAttachInfo(const char *path, bool wait_for)
+    : m_opaque_sp(new ProcessAttachInfo()) {
+  if (path && path[0])
+    m_opaque_sp->GetExecutableFile().SetFile(path, false);
+  m_opaque_sp->SetWaitForLaunch(wait_for);
 }
 
-SBAttachInfo::SBAttachInfo (const char *path, bool wait_for) :
-    m_opaque_sp (new ProcessAttachInfo())
-{
-    if (path && path[0])
-        m_opaque_sp->GetExecutableFile().SetFile(path, false);
-    m_opaque_sp->SetWaitForLaunch (wait_for);
+SBAttachInfo::SBAttachInfo(const char *path, bool wait_for, bool async)
+    : m_opaque_sp(new ProcessAttachInfo()) {
+  if (path && path[0])
+    m_opaque_sp->GetExecutableFile().SetFile(path, false);
+  m_opaque_sp->SetWaitForLaunch(wait_for);
+  m_opaque_sp->SetAsync(async);
 }
 
-SBAttachInfo::SBAttachInfo (const char *path, bool wait_for, bool async) :
-    m_opaque_sp (new ProcessAttachInfo())
-{
-    if (path && path[0])
-        m_opaque_sp->GetExecutableFile().SetFile(path, false);
-    m_opaque_sp->SetWaitForLaunch (wait_for);
-    m_opaque_sp->SetAsync(async);
+SBAttachInfo::SBAttachInfo(const SBAttachInfo &rhs)
+    : m_opaque_sp(new ProcessAttachInfo()) {
+  *m_opaque_sp = *rhs.m_opaque_sp;
 }
 
-SBAttachInfo::SBAttachInfo (const SBAttachInfo &rhs) :
-    m_opaque_sp (new ProcessAttachInfo())
-{
-    *m_opaque_sp = *rhs.m_opaque_sp;
-}
+SBAttachInfo::~SBAttachInfo() {}
 
-SBAttachInfo::~SBAttachInfo()
-{
-}
+lldb_private::ProcessAttachInfo &SBAttachInfo::ref() { return *m_opaque_sp; }
 
-lldb_private::ProcessAttachInfo &
-SBAttachInfo::ref ()
-{
-    return *m_opaque_sp;
-}
-
-SBAttachInfo &
-SBAttachInfo::operator = (const SBAttachInfo &rhs)
-{
-    if (this != &rhs)
-        *m_opaque_sp = *rhs.m_opaque_sp;
-    return *this;
+SBAttachInfo &SBAttachInfo::operator=(const SBAttachInfo &rhs) {
+  if (this != &rhs)
+    *m_opaque_sp = *rhs.m_opaque_sp;
+  return *this;
 }
 
-lldb::pid_t
-SBAttachInfo::GetProcessID ()
-{
-    return m_opaque_sp->GetProcessID();
-}
+lldb::pid_t SBAttachInfo::GetProcessID() { return m_opaque_sp->GetProcessID(); }
 
-void
-SBAttachInfo::SetProcessID (lldb::pid_t pid)
-{
-    m_opaque_sp->SetProcessID (pid);
+void SBAttachInfo::SetProcessID(lldb::pid_t pid) {
+  m_opaque_sp->SetProcessID(pid);
 }
 
-
-uint32_t
-SBAttachInfo::GetResumeCount ()
-{
-    return m_opaque_sp->GetResumeCount();
+uint32_t SBAttachInfo::GetResumeCount() {
+  return m_opaque_sp->GetResumeCount();
 }
 
-void
-SBAttachInfo::SetResumeCount (uint32_t c)
-{
-    m_opaque_sp->SetResumeCount (c);
+void SBAttachInfo::SetResumeCount(uint32_t c) {
+  m_opaque_sp->SetResumeCount(c);
 }
 
-const char *
-SBAttachInfo::GetProcessPluginName ()
-{
-    return m_opaque_sp->GetProcessPluginName();
+const char *SBAttachInfo::GetProcessPluginName() {
+  return m_opaque_sp->GetProcessPluginName();
 }
 
-void
-SBAttachInfo::SetProcessPluginName (const char *plugin_name)
-{
-    return m_opaque_sp->SetProcessPluginName (plugin_name);
+void SBAttachInfo::SetProcessPluginName(const char *plugin_name) {
+  return m_opaque_sp->SetProcessPluginName(plugin_name);
 }
 
-void
-SBAttachInfo::SetExecutable (const char *path)
-{
-    if (path && path[0])
-        m_opaque_sp->GetExecutableFile().SetFile(path, false);
-    else
-        m_opaque_sp->GetExecutableFile().Clear();
+void SBAttachInfo::SetExecutable(const char *path) {
+  if (path && path[0])
+    m_opaque_sp->GetExecutableFile().SetFile(path, false);
+  else
+    m_opaque_sp->GetExecutableFile().Clear();
 }
 
-void
-SBAttachInfo::SetExecutable (SBFileSpec exe_file)
-{
-    if (exe_file.IsValid())
-        m_opaque_sp->GetExecutableFile() = exe_file.ref();
-    else
-        m_opaque_sp->GetExecutableFile().Clear();
+void SBAttachInfo::SetExecutable(SBFileSpec exe_file) {
+  if (exe_file.IsValid())
+    m_opaque_sp->GetExecutableFile() = exe_file.ref();
+  else
+    m_opaque_sp->GetExecutableFile().Clear();
 }
 
-bool
-SBAttachInfo::GetWaitForLaunch ()
-{
-    return m_opaque_sp->GetWaitForLaunch();
+bool SBAttachInfo::GetWaitForLaunch() {
+  return m_opaque_sp->GetWaitForLaunch();
 }
 
-void
-SBAttachInfo::SetWaitForLaunch (bool b)
-{
-    m_opaque_sp->SetWaitForLaunch (b);
+void SBAttachInfo::SetWaitForLaunch(bool b) {
+  m_opaque_sp->SetWaitForLaunch(b);
 }
 
-void
-SBAttachInfo::SetWaitForLaunch (bool b, bool async)
-{
-    m_opaque_sp->SetWaitForLaunch (b);
-    m_opaque_sp->SetAsync(async);
+void SBAttachInfo::SetWaitForLaunch(bool b, bool async) {
+  m_opaque_sp->SetWaitForLaunch(b);
+  m_opaque_sp->SetAsync(async);
 }
 
-bool
-SBAttachInfo::GetIgnoreExisting ()
-{
-    return m_opaque_sp->GetIgnoreExisting();
+bool SBAttachInfo::GetIgnoreExisting() {
+  return m_opaque_sp->GetIgnoreExisting();
 }
 
-void
-SBAttachInfo::SetIgnoreExisting (bool b)
-{
-    m_opaque_sp->SetIgnoreExisting (b);
+void SBAttachInfo::SetIgnoreExisting(bool b) {
+  m_opaque_sp->SetIgnoreExisting(b);
 }
 
-uint32_t
-SBAttachInfo::GetUserID()
-{
-    return m_opaque_sp->GetUserID();
-}
+uint32_t SBAttachInfo::GetUserID() { return m_opaque_sp->GetUserID(); }
 
-uint32_t
-SBAttachInfo::GetGroupID()
-{
-    return m_opaque_sp->GetGroupID();
-}
+uint32_t SBAttachInfo::GetGroupID() { return m_opaque_sp->GetGroupID(); }
 
-bool
-SBAttachInfo::UserIDIsValid ()
-{
-    return m_opaque_sp->UserIDIsValid();
-}
+bool SBAttachInfo::UserIDIsValid() { return m_opaque_sp->UserIDIsValid(); }
 
-bool
-SBAttachInfo::GroupIDIsValid ()
-{
-    return m_opaque_sp->GroupIDIsValid();
-}
+bool SBAttachInfo::GroupIDIsValid() { return m_opaque_sp->GroupIDIsValid(); }
 
-void
-SBAttachInfo::SetUserID (uint32_t uid)
-{
-    m_opaque_sp->SetUserID (uid);
-}
+void SBAttachInfo::SetUserID(uint32_t uid) { m_opaque_sp->SetUserID(uid); }
 
-void
-SBAttachInfo::SetGroupID (uint32_t gid)
-{
-    m_opaque_sp->SetGroupID (gid);
-}
+void SBAttachInfo::SetGroupID(uint32_t gid) { m_opaque_sp->SetGroupID(gid); }
 
-uint32_t
-SBAttachInfo::GetEffectiveUserID()
-{
-    return m_opaque_sp->GetEffectiveUserID();
+uint32_t SBAttachInfo::GetEffectiveUserID() {
+  return m_opaque_sp->GetEffectiveUserID();
 }
 
-uint32_t
-SBAttachInfo::GetEffectiveGroupID()
-{
-    return m_opaque_sp->GetEffectiveGroupID();
+uint32_t SBAttachInfo::GetEffectiveGroupID() {
+  return m_opaque_sp->GetEffectiveGroupID();
 }
 
-bool
-SBAttachInfo::EffectiveUserIDIsValid ()
-{
-    return m_opaque_sp->EffectiveUserIDIsValid();
+bool SBAttachInfo::EffectiveUserIDIsValid() {
+  return m_opaque_sp->EffectiveUserIDIsValid();
 }
 
-bool
-SBAttachInfo::EffectiveGroupIDIsValid ()
-{
-    return m_opaque_sp->EffectiveGroupIDIsValid ();
+bool SBAttachInfo::EffectiveGroupIDIsValid() {
+  return m_opaque_sp->EffectiveGroupIDIsValid();
 }
 
-void
-SBAttachInfo::SetEffectiveUserID (uint32_t uid)
-{
-    m_opaque_sp->SetEffectiveUserID(uid);
+void SBAttachInfo::SetEffectiveUserID(uint32_t uid) {
+  m_opaque_sp->SetEffectiveUserID(uid);
 }
 
-void
-SBAttachInfo::SetEffectiveGroupID (uint32_t gid)
-{
-    m_opaque_sp->SetEffectiveGroupID(gid);
+void SBAttachInfo::SetEffectiveGroupID(uint32_t gid) {
+  m_opaque_sp->SetEffectiveGroupID(gid);
 }
 
-lldb::pid_t
-SBAttachInfo::GetParentProcessID ()
-{
-    return m_opaque_sp->GetParentProcessID();
+lldb::pid_t SBAttachInfo::GetParentProcessID() {
+  return m_opaque_sp->GetParentProcessID();
 }
 
-void
-SBAttachInfo::SetParentProcessID (lldb::pid_t pid)
-{
-    m_opaque_sp->SetParentProcessID (pid);
+void SBAttachInfo::SetParentProcessID(lldb::pid_t pid) {
+  m_opaque_sp->SetParentProcessID(pid);
 }
 
-bool
-SBAttachInfo::ParentProcessIDIsValid()
-{
-    return m_opaque_sp->ParentProcessIDIsValid();
+bool SBAttachInfo::ParentProcessIDIsValid() {
+  return m_opaque_sp->ParentProcessIDIsValid();
 }
 
-SBListener
-SBAttachInfo::GetListener ()
-{
-    return SBListener(m_opaque_sp->GetListener());
+SBListener SBAttachInfo::GetListener() {
+  return SBListener(m_opaque_sp->GetListener());
 }
 
-void
-SBAttachInfo::SetListener (SBListener &listener)
-{
-    m_opaque_sp->SetListener(listener.GetSP());
+void SBAttachInfo::SetListener(SBListener &listener) {
+  m_opaque_sp->SetListener(listener.GetSP());
 }

Modified: lldb/trunk/source/API/SBBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBBlock.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBBlock.cpp (original)
+++ lldb/trunk/source/API/SBBlock.cpp Tue Sep  6 15:57:50 2016
@@ -26,362 +26,272 @@
 using namespace lldb;
 using namespace lldb_private;
 
+SBBlock::SBBlock() : m_opaque_ptr(NULL) {}
 
-SBBlock::SBBlock () :
-    m_opaque_ptr (NULL)
-{
-}
-
-SBBlock::SBBlock (lldb_private::Block *lldb_object_ptr) :
-    m_opaque_ptr (lldb_object_ptr)
-{
-}
-
-SBBlock::SBBlock(const SBBlock &rhs) :
-    m_opaque_ptr (rhs.m_opaque_ptr)
-{
-}
-
-const SBBlock &
-SBBlock::operator = (const SBBlock &rhs)
-{
-    m_opaque_ptr = rhs.m_opaque_ptr;
-    return *this;
-}
-
-SBBlock::~SBBlock ()
-{
-    m_opaque_ptr = NULL;
-}
-
-bool
-SBBlock::IsValid () const
-{
-    return m_opaque_ptr != NULL;
-}
-
-bool
-SBBlock::IsInlined () const
-{
-    if (m_opaque_ptr)
-        return m_opaque_ptr->GetInlinedFunctionInfo () != NULL;
-    return false;
-}
-
-const char *
-SBBlock::GetInlinedName () const
-{
-    if (m_opaque_ptr)
-    {
-        const InlineFunctionInfo* inlined_info = m_opaque_ptr->GetInlinedFunctionInfo ();
-        if (inlined_info)
-        {
-            Function *function = m_opaque_ptr->CalculateSymbolContextFunction();
-            LanguageType language;
-            if (function)
-                language = function->GetLanguage();
-            else
-                language = lldb::eLanguageTypeUnknown;
-            return inlined_info->GetName(language).AsCString (NULL);
-        }
-    }
-    return NULL;
-}
+SBBlock::SBBlock(lldb_private::Block *lldb_object_ptr)
+    : m_opaque_ptr(lldb_object_ptr) {}
 
-SBFileSpec
-SBBlock::GetInlinedCallSiteFile () const
-{
-    SBFileSpec sb_file;
-    if (m_opaque_ptr)
-    {
-        const InlineFunctionInfo* inlined_info = m_opaque_ptr->GetInlinedFunctionInfo ();
-        if (inlined_info)
-            sb_file.SetFileSpec (inlined_info->GetCallSite().GetFile());
-    }
-    return sb_file;
-}
+SBBlock::SBBlock(const SBBlock &rhs) : m_opaque_ptr(rhs.m_opaque_ptr) {}
 
-uint32_t
-SBBlock::GetInlinedCallSiteLine () const
-{
-    if (m_opaque_ptr)
-    {
-        const InlineFunctionInfo* inlined_info = m_opaque_ptr->GetInlinedFunctionInfo ();
-        if (inlined_info)
-            return inlined_info->GetCallSite().GetLine();
-    }
-    return 0;
+const SBBlock &SBBlock::operator=(const SBBlock &rhs) {
+  m_opaque_ptr = rhs.m_opaque_ptr;
+  return *this;
 }
 
-uint32_t
-SBBlock::GetInlinedCallSiteColumn () const
-{
-    if (m_opaque_ptr)
-    {
-        const InlineFunctionInfo* inlined_info = m_opaque_ptr->GetInlinedFunctionInfo ();
-        if (inlined_info)
-            return inlined_info->GetCallSite().GetColumn();
-    }
-    return 0;
+SBBlock::~SBBlock() { m_opaque_ptr = NULL; }
+
+bool SBBlock::IsValid() const { return m_opaque_ptr != NULL; }
+
+bool SBBlock::IsInlined() const {
+  if (m_opaque_ptr)
+    return m_opaque_ptr->GetInlinedFunctionInfo() != NULL;
+  return false;
 }
 
-void
-SBBlock::AppendVariables (bool can_create, bool get_parent_variables, lldb_private::VariableList *var_list)
-{
-    if (IsValid())
-    {
-        bool show_inline = true;
-        m_opaque_ptr->AppendVariables (can_create,
-                                       get_parent_variables,
-                                       show_inline,
-                                       [](Variable*) { return true; },
-                                       var_list);
+const char *SBBlock::GetInlinedName() const {
+  if (m_opaque_ptr) {
+    const InlineFunctionInfo *inlined_info =
+        m_opaque_ptr->GetInlinedFunctionInfo();
+    if (inlined_info) {
+      Function *function = m_opaque_ptr->CalculateSymbolContextFunction();
+      LanguageType language;
+      if (function)
+        language = function->GetLanguage();
+      else
+        language = lldb::eLanguageTypeUnknown;
+      return inlined_info->GetName(language).AsCString(NULL);
     }
+  }
+  return NULL;
 }
 
-SBBlock
-SBBlock::GetParent ()
-{
-    SBBlock sb_block;
-    if (m_opaque_ptr)
-        sb_block.m_opaque_ptr = m_opaque_ptr->GetParent();
-    return sb_block;
-}
-
-lldb::SBBlock
-SBBlock::GetContainingInlinedBlock  ()
-{
-    SBBlock sb_block;
-    if (m_opaque_ptr)
-        sb_block.m_opaque_ptr = m_opaque_ptr->GetContainingInlinedBlock ();
-    return sb_block;
-}
-
-SBBlock
-SBBlock::GetSibling ()
-{
-    SBBlock sb_block;
-    if (m_opaque_ptr)
-        sb_block.m_opaque_ptr = m_opaque_ptr->GetSibling();
-    return sb_block;
-}
-
-SBBlock
-SBBlock::GetFirstChild ()
-{
-    SBBlock sb_block;
-    if (m_opaque_ptr)
-        sb_block.m_opaque_ptr = m_opaque_ptr->GetFirstChild();
-    return sb_block;
-}
-
-lldb_private::Block *
-SBBlock::GetPtr ()
-{
-    return m_opaque_ptr;
-}
-
-void
-SBBlock::SetPtr (lldb_private::Block *block)
-{
-    m_opaque_ptr = block;
-}
-
-bool
-SBBlock::GetDescription (SBStream &description)
-{
-    Stream &strm = description.ref();
-
-    if (m_opaque_ptr)
-    {
-        lldb::user_id_t id = m_opaque_ptr->GetID();
-        strm.Printf ("Block: {id: %" PRIu64 "} ", id);
-        if (IsInlined())
-        {
-            strm.Printf (" (inlined, '%s') ", GetInlinedName());
-        }
-        lldb_private::SymbolContext sc;
-        m_opaque_ptr->CalculateSymbolContext (&sc);
-        if (sc.function)
-        {
-            m_opaque_ptr->DumpAddressRanges (&strm,
-                                             sc.function->GetAddressRange().GetBaseAddress().GetFileAddress());
-        }
+SBFileSpec SBBlock::GetInlinedCallSiteFile() const {
+  SBFileSpec sb_file;
+  if (m_opaque_ptr) {
+    const InlineFunctionInfo *inlined_info =
+        m_opaque_ptr->GetInlinedFunctionInfo();
+    if (inlined_info)
+      sb_file.SetFileSpec(inlined_info->GetCallSite().GetFile());
+  }
+  return sb_file;
+}
+
+uint32_t SBBlock::GetInlinedCallSiteLine() const {
+  if (m_opaque_ptr) {
+    const InlineFunctionInfo *inlined_info =
+        m_opaque_ptr->GetInlinedFunctionInfo();
+    if (inlined_info)
+      return inlined_info->GetCallSite().GetLine();
+  }
+  return 0;
+}
+
+uint32_t SBBlock::GetInlinedCallSiteColumn() const {
+  if (m_opaque_ptr) {
+    const InlineFunctionInfo *inlined_info =
+        m_opaque_ptr->GetInlinedFunctionInfo();
+    if (inlined_info)
+      return inlined_info->GetCallSite().GetColumn();
+  }
+  return 0;
+}
+
+void SBBlock::AppendVariables(bool can_create, bool get_parent_variables,
+                              lldb_private::VariableList *var_list) {
+  if (IsValid()) {
+    bool show_inline = true;
+    m_opaque_ptr->AppendVariables(can_create, get_parent_variables, show_inline,
+                                  [](Variable *) { return true; }, var_list);
+  }
+}
+
+SBBlock SBBlock::GetParent() {
+  SBBlock sb_block;
+  if (m_opaque_ptr)
+    sb_block.m_opaque_ptr = m_opaque_ptr->GetParent();
+  return sb_block;
+}
+
+lldb::SBBlock SBBlock::GetContainingInlinedBlock() {
+  SBBlock sb_block;
+  if (m_opaque_ptr)
+    sb_block.m_opaque_ptr = m_opaque_ptr->GetContainingInlinedBlock();
+  return sb_block;
+}
+
+SBBlock SBBlock::GetSibling() {
+  SBBlock sb_block;
+  if (m_opaque_ptr)
+    sb_block.m_opaque_ptr = m_opaque_ptr->GetSibling();
+  return sb_block;
+}
+
+SBBlock SBBlock::GetFirstChild() {
+  SBBlock sb_block;
+  if (m_opaque_ptr)
+    sb_block.m_opaque_ptr = m_opaque_ptr->GetFirstChild();
+  return sb_block;
+}
+
+lldb_private::Block *SBBlock::GetPtr() { return m_opaque_ptr; }
+
+void SBBlock::SetPtr(lldb_private::Block *block) { m_opaque_ptr = block; }
+
+bool SBBlock::GetDescription(SBStream &description) {
+  Stream &strm = description.ref();
+
+  if (m_opaque_ptr) {
+    lldb::user_id_t id = m_opaque_ptr->GetID();
+    strm.Printf("Block: {id: %" PRIu64 "} ", id);
+    if (IsInlined()) {
+      strm.Printf(" (inlined, '%s') ", GetInlinedName());
     }
-    else
-        strm.PutCString ("No value");
-    
-    return true;
-}
-
-uint32_t
-SBBlock::GetNumRanges ()
-{
-    if (m_opaque_ptr)
-        return m_opaque_ptr->GetNumRanges();
-    return 0;
-}
-
-lldb::SBAddress
-SBBlock::GetRangeStartAddress (uint32_t idx)
-{
-    lldb::SBAddress sb_addr;
-    if (m_opaque_ptr)
-    {
-        AddressRange range;
-        if (m_opaque_ptr->GetRangeAtIndex(idx, range))
-        {
-            sb_addr.ref() = range.GetBaseAddress();
-        }
+    lldb_private::SymbolContext sc;
+    m_opaque_ptr->CalculateSymbolContext(&sc);
+    if (sc.function) {
+      m_opaque_ptr->DumpAddressRanges(
+          &strm,
+          sc.function->GetAddressRange().GetBaseAddress().GetFileAddress());
     }
-    return sb_addr;
+  } else
+    strm.PutCString("No value");
+
+  return true;
 }
 
-lldb::SBAddress
-SBBlock::GetRangeEndAddress (uint32_t idx)
-{
-    lldb::SBAddress sb_addr;
-    if (m_opaque_ptr)
-    {
-        AddressRange range;
-        if (m_opaque_ptr->GetRangeAtIndex(idx, range))
-        {
-            sb_addr.ref() = range.GetBaseAddress();
-            sb_addr.ref().Slide(range.GetByteSize());
-        }
-    }
-    return sb_addr;
+uint32_t SBBlock::GetNumRanges() {
+  if (m_opaque_ptr)
+    return m_opaque_ptr->GetNumRanges();
+  return 0;
 }
 
-uint32_t
-SBBlock::GetRangeIndexForBlockAddress (lldb::SBAddress block_addr)
-{
-    if (m_opaque_ptr && block_addr.IsValid())
-    {
-        return m_opaque_ptr->GetRangeIndexContainingAddress (block_addr.ref());
+lldb::SBAddress SBBlock::GetRangeStartAddress(uint32_t idx) {
+  lldb::SBAddress sb_addr;
+  if (m_opaque_ptr) {
+    AddressRange range;
+    if (m_opaque_ptr->GetRangeAtIndex(idx, range)) {
+      sb_addr.ref() = range.GetBaseAddress();
     }
+  }
+  return sb_addr;
+}
 
-    return UINT32_MAX;
+lldb::SBAddress SBBlock::GetRangeEndAddress(uint32_t idx) {
+  lldb::SBAddress sb_addr;
+  if (m_opaque_ptr) {
+    AddressRange range;
+    if (m_opaque_ptr->GetRangeAtIndex(idx, range)) {
+      sb_addr.ref() = range.GetBaseAddress();
+      sb_addr.ref().Slide(range.GetByteSize());
+    }
+  }
+  return sb_addr;
 }
 
+uint32_t SBBlock::GetRangeIndexForBlockAddress(lldb::SBAddress block_addr) {
+  if (m_opaque_ptr && block_addr.IsValid()) {
+    return m_opaque_ptr->GetRangeIndexContainingAddress(block_addr.ref());
+  }
+
+  return UINT32_MAX;
+}
+
+lldb::SBValueList SBBlock::GetVariables(lldb::SBFrame &frame, bool arguments,
+                                        bool locals, bool statics,
+                                        lldb::DynamicValueType use_dynamic) {
+  Block *block = GetPtr();
+  SBValueList value_list;
+  if (block) {
+    StackFrameSP frame_sp(frame.GetFrameSP());
+    VariableListSP variable_list_sp(block->GetBlockVariableList(true));
+
+    if (variable_list_sp) {
+      const size_t num_variables = variable_list_sp->GetSize();
+      if (num_variables) {
+        for (size_t i = 0; i < num_variables; ++i) {
+          VariableSP variable_sp(variable_list_sp->GetVariableAtIndex(i));
+          if (variable_sp) {
+            bool add_variable = false;
+            switch (variable_sp->GetScope()) {
+            case eValueTypeVariableGlobal:
+            case eValueTypeVariableStatic:
+            case eValueTypeVariableThreadLocal:
+              add_variable = statics;
+              break;
+
+            case eValueTypeVariableArgument:
+              add_variable = arguments;
+              break;
+
+            case eValueTypeVariableLocal:
+              add_variable = locals;
+              break;
 
-lldb::SBValueList
-SBBlock::GetVariables (lldb::SBFrame& frame,
-                       bool arguments,
-                       bool locals,
-                       bool statics,
-                       lldb::DynamicValueType use_dynamic)
-{
-    Block *block = GetPtr();
-    SBValueList value_list;
-    if (block)
-    {
-        StackFrameSP frame_sp(frame.GetFrameSP());
-        VariableListSP variable_list_sp (block->GetBlockVariableList (true));
-
-        if (variable_list_sp)
-        {
-            const size_t num_variables = variable_list_sp->GetSize();
-            if (num_variables)
-            {
-                for (size_t i = 0; i < num_variables; ++i)
-                {
-                    VariableSP variable_sp (variable_list_sp->GetVariableAtIndex(i));
-                    if (variable_sp)
-                    {
-                        bool add_variable = false;
-                        switch (variable_sp->GetScope())
-                        {
-                            case eValueTypeVariableGlobal:
-                            case eValueTypeVariableStatic:
-                            case eValueTypeVariableThreadLocal:
-                                add_variable = statics;
-                                break;
-                                
-                            case eValueTypeVariableArgument:
-                                add_variable = arguments;
-                                break;
-                                
-                            case eValueTypeVariableLocal:
-                                add_variable = locals;
-                                break;
-                                
-                            default:
-                                break;
-                        }
-                        if (add_variable)
-                        {
-                            if (frame_sp)
-                            {
-                                lldb::ValueObjectSP valobj_sp(frame_sp->GetValueObjectForFrameVariable (variable_sp,eNoDynamicValues));
-                                SBValue value_sb;
-                                value_sb.SetSP(valobj_sp, use_dynamic);
-                                value_list.Append (value_sb);
-                            }
-                        }
-                    }
-                }
+            default:
+              break;
+            }
+            if (add_variable) {
+              if (frame_sp) {
+                lldb::ValueObjectSP valobj_sp(
+                    frame_sp->GetValueObjectForFrameVariable(variable_sp,
+                                                             eNoDynamicValues));
+                SBValue value_sb;
+                value_sb.SetSP(valobj_sp, use_dynamic);
+                value_list.Append(value_sb);
+              }
             }
-        }        
+          }
+        }
+      }
     }
-    return value_list;
+  }
+  return value_list;
 }
 
-lldb::SBValueList
-SBBlock::GetVariables (lldb::SBTarget& target,
-                       bool arguments,
-                       bool locals,
-                       bool statics)
-{
-    Block *block = GetPtr();
-    
-    SBValueList value_list;
-    if (block)
-    {
-        TargetSP target_sp(target.GetSP());
-        
-        VariableListSP variable_list_sp (block->GetBlockVariableList (true));
-        
-        if (variable_list_sp)
-        {
-            const size_t num_variables = variable_list_sp->GetSize();
-            if (num_variables)
-            {
-                for (size_t i = 0; i < num_variables; ++i)
-                {
-                    VariableSP variable_sp (variable_list_sp->GetVariableAtIndex(i));
-                    if (variable_sp)
-                    {
-                        bool add_variable = false;
-                        switch (variable_sp->GetScope())
-                        {
-                            case eValueTypeVariableGlobal:
-                            case eValueTypeVariableStatic:
-                            case eValueTypeVariableThreadLocal:
-                                add_variable = statics;
-                                break;
-                                
-                            case eValueTypeVariableArgument:
-                                add_variable = arguments;
-                                break;
-                                
-                            case eValueTypeVariableLocal:
-                                add_variable = locals;
-                                break;
-                                
-                            default:
-                                break;
-                        }
-                        if (add_variable)
-                        {
-                            if (target_sp)
-                                value_list.Append (ValueObjectVariable::Create (target_sp.get(), variable_sp));
-                        }
-                    }
-                }
+lldb::SBValueList SBBlock::GetVariables(lldb::SBTarget &target, bool arguments,
+                                        bool locals, bool statics) {
+  Block *block = GetPtr();
+
+  SBValueList value_list;
+  if (block) {
+    TargetSP target_sp(target.GetSP());
+
+    VariableListSP variable_list_sp(block->GetBlockVariableList(true));
+
+    if (variable_list_sp) {
+      const size_t num_variables = variable_list_sp->GetSize();
+      if (num_variables) {
+        for (size_t i = 0; i < num_variables; ++i) {
+          VariableSP variable_sp(variable_list_sp->GetVariableAtIndex(i));
+          if (variable_sp) {
+            bool add_variable = false;
+            switch (variable_sp->GetScope()) {
+            case eValueTypeVariableGlobal:
+            case eValueTypeVariableStatic:
+            case eValueTypeVariableThreadLocal:
+              add_variable = statics;
+              break;
+
+            case eValueTypeVariableArgument:
+              add_variable = arguments;
+              break;
+
+            case eValueTypeVariableLocal:
+              add_variable = locals;
+              break;
+
+            default:
+              break;
+            }
+            if (add_variable) {
+              if (target_sp)
+                value_list.Append(
+                    ValueObjectVariable::Create(target_sp.get(), variable_sp));
             }
+          }
         }
-    }        
-    return value_list;
+      }
+    }
+  }
+  return value_list;
 }
-

Modified: lldb/trunk/source/API/SBBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBBreakpoint.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBBreakpoint.cpp (original)
+++ lldb/trunk/source/API/SBBreakpoint.cpp Tue Sep  6 15:57:50 2016
@@ -41,750 +41,648 @@
 using namespace lldb;
 using namespace lldb_private;
 
-struct CallbackData
-{
-    SBBreakpoint::BreakpointHitCallback callback;
-    void *callback_baton;
+struct CallbackData {
+  SBBreakpoint::BreakpointHitCallback callback;
+  void *callback_baton;
 };
 
-class SBBreakpointCallbackBaton : public Baton
-{
+class SBBreakpointCallbackBaton : public Baton {
 public:
-    SBBreakpointCallbackBaton (SBBreakpoint::BreakpointHitCallback callback, void *baton) :
-        Baton (new CallbackData)
-    {
-        CallbackData *data = (CallbackData *)m_data;
-        data->callback = callback;
-        data->callback_baton = baton;
-    }
-    
-    ~SBBreakpointCallbackBaton() override
-    {
-        CallbackData *data = (CallbackData *)m_data;
-
-        if (data)
-        {
-            delete data;
-            m_data = nullptr;
-        }
+  SBBreakpointCallbackBaton(SBBreakpoint::BreakpointHitCallback callback,
+                            void *baton)
+      : Baton(new CallbackData) {
+    CallbackData *data = (CallbackData *)m_data;
+    data->callback = callback;
+    data->callback_baton = baton;
+  }
+
+  ~SBBreakpointCallbackBaton() override {
+    CallbackData *data = (CallbackData *)m_data;
+
+    if (data) {
+      delete data;
+      m_data = nullptr;
     }
+  }
 };
 
-SBBreakpoint::SBBreakpoint () :
-    m_opaque_sp ()
-{
-}
+SBBreakpoint::SBBreakpoint() : m_opaque_sp() {}
 
-SBBreakpoint::SBBreakpoint (const SBBreakpoint& rhs) :
-    m_opaque_sp (rhs.m_opaque_sp)
-{
-}
+SBBreakpoint::SBBreakpoint(const SBBreakpoint &rhs)
+    : m_opaque_sp(rhs.m_opaque_sp) {}
 
-SBBreakpoint::SBBreakpoint (const lldb::BreakpointSP &bp_sp) :
-    m_opaque_sp (bp_sp)
-{
-}
+SBBreakpoint::SBBreakpoint(const lldb::BreakpointSP &bp_sp)
+    : m_opaque_sp(bp_sp) {}
 
 SBBreakpoint::~SBBreakpoint() = default;
 
-const SBBreakpoint &
-SBBreakpoint::operator = (const SBBreakpoint& rhs)
-{
-    if (this != &rhs)
-        m_opaque_sp = rhs.m_opaque_sp;
-    return *this;
-}
-
-bool
-SBBreakpoint::operator == (const lldb::SBBreakpoint& rhs)
-{
-    if (m_opaque_sp && rhs.m_opaque_sp)
-        return m_opaque_sp.get() == rhs.m_opaque_sp.get();
-    return false;
-}
-
-bool
-SBBreakpoint::operator != (const lldb::SBBreakpoint& rhs)
-{
-    if (m_opaque_sp && rhs.m_opaque_sp)
-        return m_opaque_sp.get() != rhs.m_opaque_sp.get();
-    return (m_opaque_sp && !rhs.m_opaque_sp) || (rhs.m_opaque_sp && !m_opaque_sp);
-}
-
-break_id_t
-SBBreakpoint::GetID () const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    break_id_t break_id = LLDB_INVALID_BREAK_ID;
-    if (m_opaque_sp)
-        break_id = m_opaque_sp->GetID();
-
-    if (log)
-    {
-        if (break_id == LLDB_INVALID_BREAK_ID)
-            log->Printf ("SBBreakpoint(%p)::GetID () => LLDB_INVALID_BREAK_ID",
-                         static_cast<void*>(m_opaque_sp.get()));
-        else
-            log->Printf ("SBBreakpoint(%p)::GetID () => %u",
-                         static_cast<void*>(m_opaque_sp.get()), break_id);
-    }
-
-    return break_id;
-}
-
-bool
-SBBreakpoint::IsValid() const
-{
-    if (!m_opaque_sp)
-        return false;
-    else if (m_opaque_sp->GetTarget().GetBreakpointByID(m_opaque_sp->GetID()))
-       return true;
-    else
-        return false;
-}
-
-void
-SBBreakpoint::ClearAllBreakpointSites ()
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->ClearAllBreakpointSites ();
-    }
-}
-
-SBBreakpointLocation
-SBBreakpoint::FindLocationByAddress (addr_t vm_addr)
-{
-    SBBreakpointLocation sb_bp_location;
-
-    if (m_opaque_sp)
-    {
-        if (vm_addr != LLDB_INVALID_ADDRESS)
-        {
-            std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-            Address address;
-            Target &target = m_opaque_sp->GetTarget();
-            if (!target.GetSectionLoadList().ResolveLoadAddress(vm_addr, address))
-            {
-                address.SetRawAddress (vm_addr);
-            }
-            sb_bp_location.SetLocation (m_opaque_sp->FindLocationByAddress (address));
-        }
-    }
-    return sb_bp_location;
-}
-
-break_id_t
-SBBreakpoint::FindLocationIDByAddress (addr_t vm_addr)
-{
-    break_id_t break_id = LLDB_INVALID_BREAK_ID;
-
-    if (m_opaque_sp && vm_addr != LLDB_INVALID_ADDRESS)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        Address address;
-        Target &target = m_opaque_sp->GetTarget();
-        if (!target.GetSectionLoadList().ResolveLoadAddress(vm_addr, address))
-        {
-            address.SetRawAddress (vm_addr);
-        }
-        break_id = m_opaque_sp->FindLocationIDByAddress (address);
-    }
-
-    return break_id;
-}
-
-SBBreakpointLocation
-SBBreakpoint::FindLocationByID (break_id_t bp_loc_id)
-{
-    SBBreakpointLocation sb_bp_location;
-
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        sb_bp_location.SetLocation (m_opaque_sp->FindLocationByID (bp_loc_id));
-    }
-
-    return sb_bp_location;
+const SBBreakpoint &SBBreakpoint::operator=(const SBBreakpoint &rhs) {
+  if (this != &rhs)
+    m_opaque_sp = rhs.m_opaque_sp;
+  return *this;
 }
 
-SBBreakpointLocation
-SBBreakpoint::GetLocationAtIndex (uint32_t index)
-{
-    SBBreakpointLocation sb_bp_location;
-
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        sb_bp_location.SetLocation (m_opaque_sp->GetLocationAtIndex (index));
-    }
-
-    return sb_bp_location;
-}
-
-void
-SBBreakpoint::SetEnabled (bool enable)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::SetEnabled (enabled=%i)",
-                     static_cast<void*>(m_opaque_sp.get()), enable);
-
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->SetEnabled (enable);
-    }
+bool SBBreakpoint::operator==(const lldb::SBBreakpoint &rhs) {
+  if (m_opaque_sp && rhs.m_opaque_sp)
+    return m_opaque_sp.get() == rhs.m_opaque_sp.get();
+  return false;
 }
 
-bool
-SBBreakpoint::IsEnabled ()
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        return m_opaque_sp->IsEnabled();
-    }
-    else
-        return false;
+bool SBBreakpoint::operator!=(const lldb::SBBreakpoint &rhs) {
+  if (m_opaque_sp && rhs.m_opaque_sp)
+    return m_opaque_sp.get() != rhs.m_opaque_sp.get();
+  return (m_opaque_sp && !rhs.m_opaque_sp) || (rhs.m_opaque_sp && !m_opaque_sp);
 }
 
-void
-SBBreakpoint::SetOneShot (bool one_shot)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::SetOneShot (one_shot=%i)",
-                     static_cast<void*>(m_opaque_sp.get()), one_shot);
-
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->SetOneShot (one_shot);
-    }
-}
+break_id_t SBBreakpoint::GetID() const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-bool
-SBBreakpoint::IsOneShot () const
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        return m_opaque_sp->IsOneShot();
-    }
-    else
-        return false;
-}
+  break_id_t break_id = LLDB_INVALID_BREAK_ID;
+  if (m_opaque_sp)
+    break_id = m_opaque_sp->GetID();
 
-bool
-SBBreakpoint::IsInternal ()
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        return m_opaque_sp->IsInternal();
-    }
+  if (log) {
+    if (break_id == LLDB_INVALID_BREAK_ID)
+      log->Printf("SBBreakpoint(%p)::GetID () => LLDB_INVALID_BREAK_ID",
+                  static_cast<void *>(m_opaque_sp.get()));
     else
-        return false;
-}
+      log->Printf("SBBreakpoint(%p)::GetID () => %u",
+                  static_cast<void *>(m_opaque_sp.get()), break_id);
+  }
 
-void
-SBBreakpoint::SetIgnoreCount (uint32_t count)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::SetIgnoreCount (count=%u)",
-                     static_cast<void*>(m_opaque_sp.get()), count);
-
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->SetIgnoreCount (count);
-    }
+  return break_id;
 }
 
-void
-SBBreakpoint::SetCondition (const char *condition)
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->SetCondition (condition);
-    }
+bool SBBreakpoint::IsValid() const {
+  if (!m_opaque_sp)
+    return false;
+  else if (m_opaque_sp->GetTarget().GetBreakpointByID(m_opaque_sp->GetID()))
+    return true;
+  else
+    return false;
 }
 
-const char *
-SBBreakpoint::GetCondition ()
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        return m_opaque_sp->GetConditionText ();
-    }
-    return nullptr;
+void SBBreakpoint::ClearAllBreakpointSites() {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    m_opaque_sp->ClearAllBreakpointSites();
+  }
 }
 
-uint32_t
-SBBreakpoint::GetHitCount () const
-{
-    uint32_t count = 0;
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        count = m_opaque_sp->GetHitCount();
-    }
-
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::GetHitCount () => %u",
-                     static_cast<void*>(m_opaque_sp.get()), count);
-
-    return count;
-}
+SBBreakpointLocation SBBreakpoint::FindLocationByAddress(addr_t vm_addr) {
+  SBBreakpointLocation sb_bp_location;
 
-uint32_t
-SBBreakpoint::GetIgnoreCount () const
-{
-    uint32_t count = 0;
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        count = m_opaque_sp->GetIgnoreCount();
+  if (m_opaque_sp) {
+    if (vm_addr != LLDB_INVALID_ADDRESS) {
+      std::lock_guard<std::recursive_mutex> guard(
+          m_opaque_sp->GetTarget().GetAPIMutex());
+      Address address;
+      Target &target = m_opaque_sp->GetTarget();
+      if (!target.GetSectionLoadList().ResolveLoadAddress(vm_addr, address)) {
+        address.SetRawAddress(vm_addr);
+      }
+      sb_bp_location.SetLocation(m_opaque_sp->FindLocationByAddress(address));
     }
-
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::GetIgnoreCount () => %u",
-                     static_cast<void*>(m_opaque_sp.get()), count);
-
-    return count;
+  }
+  return sb_bp_location;
 }
 
-void
-SBBreakpoint::SetThreadID (tid_t tid)
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->SetThreadID (tid);
-    }
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::SetThreadID (tid=0x%4.4" PRIx64 ")",
-                     static_cast<void*>(m_opaque_sp.get()), tid);
-}
+break_id_t SBBreakpoint::FindLocationIDByAddress(addr_t vm_addr) {
+  break_id_t break_id = LLDB_INVALID_BREAK_ID;
 
-tid_t
-SBBreakpoint::GetThreadID ()
-{
-    tid_t tid = LLDB_INVALID_THREAD_ID;
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        tid = m_opaque_sp->GetThreadID();
+  if (m_opaque_sp && vm_addr != LLDB_INVALID_ADDRESS) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    Address address;
+    Target &target = m_opaque_sp->GetTarget();
+    if (!target.GetSectionLoadList().ResolveLoadAddress(vm_addr, address)) {
+      address.SetRawAddress(vm_addr);
     }
+    break_id = m_opaque_sp->FindLocationIDByAddress(address);
+  }
 
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::GetThreadID () => 0x%4.4" PRIx64,
-                     static_cast<void*>(m_opaque_sp.get()), tid);
-    return tid;
-}
-
-void
-SBBreakpoint::SetThreadIndex (uint32_t index)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::SetThreadIndex (%u)",
-                     static_cast<void*>(m_opaque_sp.get()), index);
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->GetOptions()->GetThreadSpec()->SetIndex (index);
-    }
+  return break_id;
 }
 
-uint32_t
-SBBreakpoint::GetThreadIndex() const
-{
-    uint32_t thread_idx = UINT32_MAX;
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        const ThreadSpec *thread_spec = m_opaque_sp->GetOptions()->GetThreadSpecNoCreate();
-        if (thread_spec != nullptr)
-            thread_idx = thread_spec->GetIndex();
-    }
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::GetThreadIndex () => %u",
-                     static_cast<void*>(m_opaque_sp.get()), thread_idx);
-
-    return thread_idx;
-}
-
-void
-SBBreakpoint::SetThreadName (const char *thread_name)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::SetThreadName (%s)",
-                     static_cast<void*>(m_opaque_sp.get()), thread_name);
-
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->GetOptions()->GetThreadSpec()->SetName (thread_name);
-    }
-}
+SBBreakpointLocation SBBreakpoint::FindLocationByID(break_id_t bp_loc_id) {
+  SBBreakpointLocation sb_bp_location;
 
-const char *
-SBBreakpoint::GetThreadName () const
-{
-    const char *name = nullptr;
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        const ThreadSpec *thread_spec = m_opaque_sp->GetOptions()->GetThreadSpecNoCreate();
-        if (thread_spec != nullptr)
-            name = thread_spec->GetName();
-    }
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::GetThreadName () => %s",
-                     static_cast<void*>(m_opaque_sp.get()), name);
-
-    return name;
-}
-
-void
-SBBreakpoint::SetQueueName (const char *queue_name)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::SetQueueName (%s)",
-                     static_cast<void*>(m_opaque_sp.get()), queue_name);
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->GetOptions()->GetThreadSpec()->SetQueueName (queue_name);
-    }
-}
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    sb_bp_location.SetLocation(m_opaque_sp->FindLocationByID(bp_loc_id));
+  }
 
-const char *
-SBBreakpoint::GetQueueName () const
-{
-    const char *name = nullptr;
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        const ThreadSpec *thread_spec = m_opaque_sp->GetOptions()->GetThreadSpecNoCreate();
-        if (thread_spec)
-            name = thread_spec->GetQueueName();
-    }
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::GetQueueName () => %s",
-                     static_cast<void*>(m_opaque_sp.get()), name);
-
-    return name;
-}
-
-size_t
-SBBreakpoint::GetNumResolvedLocations() const
-{
-    size_t num_resolved = 0;
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        num_resolved = m_opaque_sp->GetNumResolvedLocations();
-    }
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::GetNumResolvedLocations () => %" PRIu64,
-                     static_cast<void*>(m_opaque_sp.get()),
-                     static_cast<uint64_t>(num_resolved));
-    return num_resolved;
-}
-
-size_t
-SBBreakpoint::GetNumLocations() const
-{
-    size_t num_locs = 0;
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        num_locs = m_opaque_sp->GetNumLocations();
-    }
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::GetNumLocations () => %" PRIu64,
-                     static_cast<void*>(m_opaque_sp.get()),
-                     static_cast<uint64_t>(num_locs));
-    return num_locs;
-}
-
-bool
-SBBreakpoint::GetDescription (SBStream &s)
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        s.Printf("SBBreakpoint: id = %i, ", m_opaque_sp->GetID());
-        m_opaque_sp->GetResolverDescription (s.get());
-        m_opaque_sp->GetFilterDescription (s.get());
-        const size_t num_locations = m_opaque_sp->GetNumLocations ();
-        s.Printf(", locations = %" PRIu64, (uint64_t)num_locations);
-        return true;
-    }
-    s.Printf ("No value");
-    return false;
+  return sb_bp_location;
 }
 
-bool
-SBBreakpoint::PrivateBreakpointHitCallback(void *baton,
-                                           StoppointCallbackContext *ctx,
-                                           lldb::user_id_t break_id,
-                                           lldb::user_id_t break_loc_id)
-{
-    ExecutionContext exe_ctx (ctx->exe_ctx_ref);
-    BreakpointSP bp_sp(exe_ctx.GetTargetRef().GetBreakpointList().FindBreakpointByID(break_id));
-    if (baton && bp_sp)
-    {
-        CallbackData *data = (CallbackData *)baton;
-        lldb_private::Breakpoint *bp = bp_sp.get();
-        if (bp && data->callback)
-        {
-            Process *process = exe_ctx.GetProcessPtr();
-            if (process)
-            {
-                SBProcess sb_process (process->shared_from_this());
-                SBThread sb_thread;
-                SBBreakpointLocation sb_location;
-                assert (bp_sp);
-                sb_location.SetLocation (bp_sp->FindLocationByID (break_loc_id));
-                Thread *thread = exe_ctx.GetThreadPtr();
-                if (thread)
-                    sb_thread.SetThread(thread->shared_from_this());
-
-                return data->callback (data->callback_baton, 
-                                          sb_process, 
-                                          sb_thread, 
-                                          sb_location);
-            }
-        }
-    }
-    return true;    // Return true if we should stop at this breakpoint
-}
+SBBreakpointLocation SBBreakpoint::GetLocationAtIndex(uint32_t index) {
+  SBBreakpointLocation sb_bp_location;
 
-void
-SBBreakpoint::SetCallback (BreakpointHitCallback callback, void *baton)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-    {
-        void *pointer = &callback;
-        log->Printf ("SBBreakpoint(%p)::SetCallback (callback=%p, baton=%p)",
-                     static_cast<void*>(m_opaque_sp.get()),
-                     *static_cast<void**>(&pointer), static_cast<void*>(baton));
-    }
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    sb_bp_location.SetLocation(m_opaque_sp->GetLocationAtIndex(index));
+  }
 
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        BatonSP baton_sp(new SBBreakpointCallbackBaton (callback, baton));
-        m_opaque_sp->SetCallback (SBBreakpoint::PrivateBreakpointHitCallback, baton_sp, false);
-    }
+  return sb_bp_location;
 }
 
-void
-SBBreakpoint::SetScriptCallbackFunction (const char *callback_function_name)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::SetScriptCallbackFunction (callback=%s)",
-                     static_cast<void*>(m_opaque_sp.get()),
-                     callback_function_name);
-
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        BreakpointOptions *bp_options = m_opaque_sp->GetOptions();
-        m_opaque_sp->GetTarget().GetDebugger().GetCommandInterpreter().GetScriptInterpreter()->SetBreakpointCommandCallbackFunction (bp_options,
-                                                                                                                                                   callback_function_name);
-    }
-}
+void SBBreakpoint::SetEnabled(bool enable) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-SBError
-SBBreakpoint::SetScriptCallbackBody (const char *callback_body_text)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::SetScriptCallbackBody: callback body:\n%s)",
-                     static_cast<void*>(m_opaque_sp.get()), callback_body_text);
-
-    SBError sb_error;
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        BreakpointOptions *bp_options = m_opaque_sp->GetOptions();
-        Error error =  m_opaque_sp->GetTarget().GetDebugger().GetCommandInterpreter().GetScriptInterpreter()->SetBreakpointCommandCallback (bp_options,
-                                                                                                                                    callback_body_text);
-        sb_error.SetError(error);
-    }
-    else
-        sb_error.SetErrorString("invalid breakpoint");
+  if (log)
+    log->Printf("SBBreakpoint(%p)::SetEnabled (enabled=%i)",
+                static_cast<void *>(m_opaque_sp.get()), enable);
 
-    return sb_error;
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    m_opaque_sp->SetEnabled(enable);
+  }
 }
 
-bool
-SBBreakpoint::AddName (const char *new_name)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::AddName (name=%s)",
-                     static_cast<void*>(m_opaque_sp.get()),
-                     new_name);
-
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        Error error;  // Think I'm just going to swallow the error here, it's probably more annoying to have to provide it.
-        return m_opaque_sp->AddName(new_name, error);
-    }
-
+bool SBBreakpoint::IsEnabled() {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    return m_opaque_sp->IsEnabled();
+  } else
     return false;
 }
 
-void
-SBBreakpoint::RemoveName (const char *name_to_remove)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::RemoveName (name=%s)",
-                     static_cast<void*>(m_opaque_sp.get()),
-                     name_to_remove);
-
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->RemoveName(name_to_remove);
-    }
-}
-
-bool
-SBBreakpoint::MatchesName (const char *name)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::MatchesName (name=%s)",
-                     static_cast<void*>(m_opaque_sp.get()),
-                     name);
-
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        return m_opaque_sp->MatchesName(name);
-    }
+void SBBreakpoint::SetOneShot(bool one_shot) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
+  if (log)
+    log->Printf("SBBreakpoint(%p)::SetOneShot (one_shot=%i)",
+                static_cast<void *>(m_opaque_sp.get()), one_shot);
+
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    m_opaque_sp->SetOneShot(one_shot);
+  }
+}
+
+bool SBBreakpoint::IsOneShot() const {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    return m_opaque_sp->IsOneShot();
+  } else
     return false;
 }
 
-void
-SBBreakpoint::GetNames (SBStringList &names)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::GetNames ()",
-                     static_cast<void*>(m_opaque_sp.get()));
-
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        std::vector<std::string> names_vec;
-        m_opaque_sp->GetNames(names_vec);
-        for (std::string name : names_vec)
-        {
-            names.AppendString (name.c_str());
-        }
-    }
-}
-
-lldb_private::Breakpoint *
-SBBreakpoint::operator->() const
-{
-    return m_opaque_sp.get();
-}
-
-lldb_private::Breakpoint *
-SBBreakpoint::get() const
-{
-    return m_opaque_sp.get();
-}
-
-lldb::BreakpointSP &
-SBBreakpoint::operator *()
-{
-    return m_opaque_sp;
+bool SBBreakpoint::IsInternal() {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    return m_opaque_sp->IsInternal();
+  } else
+    return false;
 }
 
-const lldb::BreakpointSP &
-SBBreakpoint::operator *() const
-{
-    return m_opaque_sp;
-}
+void SBBreakpoint::SetIgnoreCount(uint32_t count) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-bool
-SBBreakpoint::EventIsBreakpointEvent (const lldb::SBEvent &event)
-{
-    return Breakpoint::BreakpointEventData::GetEventDataFromEvent(event.get()) != nullptr;
+  if (log)
+    log->Printf("SBBreakpoint(%p)::SetIgnoreCount (count=%u)",
+                static_cast<void *>(m_opaque_sp.get()), count);
+
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    m_opaque_sp->SetIgnoreCount(count);
+  }
+}
+
+void SBBreakpoint::SetCondition(const char *condition) {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    m_opaque_sp->SetCondition(condition);
+  }
+}
+
+const char *SBBreakpoint::GetCondition() {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    return m_opaque_sp->GetConditionText();
+  }
+  return nullptr;
+}
+
+uint32_t SBBreakpoint::GetHitCount() const {
+  uint32_t count = 0;
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    count = m_opaque_sp->GetHitCount();
+  }
+
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBBreakpoint(%p)::GetHitCount () => %u",
+                static_cast<void *>(m_opaque_sp.get()), count);
+
+  return count;
+}
+
+uint32_t SBBreakpoint::GetIgnoreCount() const {
+  uint32_t count = 0;
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    count = m_opaque_sp->GetIgnoreCount();
+  }
+
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBBreakpoint(%p)::GetIgnoreCount () => %u",
+                static_cast<void *>(m_opaque_sp.get()), count);
+
+  return count;
+}
+
+void SBBreakpoint::SetThreadID(tid_t tid) {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    m_opaque_sp->SetThreadID(tid);
+  }
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBBreakpoint(%p)::SetThreadID (tid=0x%4.4" PRIx64 ")",
+                static_cast<void *>(m_opaque_sp.get()), tid);
+}
+
+tid_t SBBreakpoint::GetThreadID() {
+  tid_t tid = LLDB_INVALID_THREAD_ID;
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    tid = m_opaque_sp->GetThreadID();
+  }
+
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBBreakpoint(%p)::GetThreadID () => 0x%4.4" PRIx64,
+                static_cast<void *>(m_opaque_sp.get()), tid);
+  return tid;
+}
+
+void SBBreakpoint::SetThreadIndex(uint32_t index) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBBreakpoint(%p)::SetThreadIndex (%u)",
+                static_cast<void *>(m_opaque_sp.get()), index);
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    m_opaque_sp->GetOptions()->GetThreadSpec()->SetIndex(index);
+  }
+}
+
+uint32_t SBBreakpoint::GetThreadIndex() const {
+  uint32_t thread_idx = UINT32_MAX;
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    const ThreadSpec *thread_spec =
+        m_opaque_sp->GetOptions()->GetThreadSpecNoCreate();
+    if (thread_spec != nullptr)
+      thread_idx = thread_spec->GetIndex();
+  }
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBBreakpoint(%p)::GetThreadIndex () => %u",
+                static_cast<void *>(m_opaque_sp.get()), thread_idx);
+
+  return thread_idx;
+}
+
+void SBBreakpoint::SetThreadName(const char *thread_name) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBBreakpoint(%p)::SetThreadName (%s)",
+                static_cast<void *>(m_opaque_sp.get()), thread_name);
+
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    m_opaque_sp->GetOptions()->GetThreadSpec()->SetName(thread_name);
+  }
+}
+
+const char *SBBreakpoint::GetThreadName() const {
+  const char *name = nullptr;
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    const ThreadSpec *thread_spec =
+        m_opaque_sp->GetOptions()->GetThreadSpecNoCreate();
+    if (thread_spec != nullptr)
+      name = thread_spec->GetName();
+  }
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBBreakpoint(%p)::GetThreadName () => %s",
+                static_cast<void *>(m_opaque_sp.get()), name);
+
+  return name;
+}
+
+void SBBreakpoint::SetQueueName(const char *queue_name) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBBreakpoint(%p)::SetQueueName (%s)",
+                static_cast<void *>(m_opaque_sp.get()), queue_name);
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    m_opaque_sp->GetOptions()->GetThreadSpec()->SetQueueName(queue_name);
+  }
+}
+
+const char *SBBreakpoint::GetQueueName() const {
+  const char *name = nullptr;
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    const ThreadSpec *thread_spec =
+        m_opaque_sp->GetOptions()->GetThreadSpecNoCreate();
+    if (thread_spec)
+      name = thread_spec->GetQueueName();
+  }
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBBreakpoint(%p)::GetQueueName () => %s",
+                static_cast<void *>(m_opaque_sp.get()), name);
+
+  return name;
+}
+
+size_t SBBreakpoint::GetNumResolvedLocations() const {
+  size_t num_resolved = 0;
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    num_resolved = m_opaque_sp->GetNumResolvedLocations();
+  }
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBBreakpoint(%p)::GetNumResolvedLocations () => %" PRIu64,
+                static_cast<void *>(m_opaque_sp.get()),
+                static_cast<uint64_t>(num_resolved));
+  return num_resolved;
+}
+
+size_t SBBreakpoint::GetNumLocations() const {
+  size_t num_locs = 0;
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    num_locs = m_opaque_sp->GetNumLocations();
+  }
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBBreakpoint(%p)::GetNumLocations () => %" PRIu64,
+                static_cast<void *>(m_opaque_sp.get()),
+                static_cast<uint64_t>(num_locs));
+  return num_locs;
+}
+
+bool SBBreakpoint::GetDescription(SBStream &s) {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    s.Printf("SBBreakpoint: id = %i, ", m_opaque_sp->GetID());
+    m_opaque_sp->GetResolverDescription(s.get());
+    m_opaque_sp->GetFilterDescription(s.get());
+    const size_t num_locations = m_opaque_sp->GetNumLocations();
+    s.Printf(", locations = %" PRIu64, (uint64_t)num_locations);
+    return true;
+  }
+  s.Printf("No value");
+  return false;
+}
+
+bool SBBreakpoint::PrivateBreakpointHitCallback(void *baton,
+                                                StoppointCallbackContext *ctx,
+                                                lldb::user_id_t break_id,
+                                                lldb::user_id_t break_loc_id) {
+  ExecutionContext exe_ctx(ctx->exe_ctx_ref);
+  BreakpointSP bp_sp(
+      exe_ctx.GetTargetRef().GetBreakpointList().FindBreakpointByID(break_id));
+  if (baton && bp_sp) {
+    CallbackData *data = (CallbackData *)baton;
+    lldb_private::Breakpoint *bp = bp_sp.get();
+    if (bp && data->callback) {
+      Process *process = exe_ctx.GetProcessPtr();
+      if (process) {
+        SBProcess sb_process(process->shared_from_this());
+        SBThread sb_thread;
+        SBBreakpointLocation sb_location;
+        assert(bp_sp);
+        sb_location.SetLocation(bp_sp->FindLocationByID(break_loc_id));
+        Thread *thread = exe_ctx.GetThreadPtr();
+        if (thread)
+          sb_thread.SetThread(thread->shared_from_this());
+
+        return data->callback(data->callback_baton, sb_process, sb_thread,
+                              sb_location);
+      }
+    }
+  }
+  return true; // Return true if we should stop at this breakpoint
+}
+
+void SBBreakpoint::SetCallback(BreakpointHitCallback callback, void *baton) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (log) {
+    void *pointer = &callback;
+    log->Printf("SBBreakpoint(%p)::SetCallback (callback=%p, baton=%p)",
+                static_cast<void *>(m_opaque_sp.get()),
+                *static_cast<void **>(&pointer), static_cast<void *>(baton));
+  }
+
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    BatonSP baton_sp(new SBBreakpointCallbackBaton(callback, baton));
+    m_opaque_sp->SetCallback(SBBreakpoint::PrivateBreakpointHitCallback,
+                             baton_sp, false);
+  }
+}
+
+void SBBreakpoint::SetScriptCallbackFunction(
+    const char *callback_function_name) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (log)
+    log->Printf("SBBreakpoint(%p)::SetScriptCallbackFunction (callback=%s)",
+                static_cast<void *>(m_opaque_sp.get()), callback_function_name);
+
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    BreakpointOptions *bp_options = m_opaque_sp->GetOptions();
+    m_opaque_sp->GetTarget()
+        .GetDebugger()
+        .GetCommandInterpreter()
+        .GetScriptInterpreter()
+        ->SetBreakpointCommandCallbackFunction(bp_options,
+                                               callback_function_name);
+  }
+}
+
+SBError SBBreakpoint::SetScriptCallbackBody(const char *callback_body_text) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (log)
+    log->Printf("SBBreakpoint(%p)::SetScriptCallbackBody: callback body:\n%s)",
+                static_cast<void *>(m_opaque_sp.get()), callback_body_text);
+
+  SBError sb_error;
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    BreakpointOptions *bp_options = m_opaque_sp->GetOptions();
+    Error error =
+        m_opaque_sp->GetTarget()
+            .GetDebugger()
+            .GetCommandInterpreter()
+            .GetScriptInterpreter()
+            ->SetBreakpointCommandCallback(bp_options, callback_body_text);
+    sb_error.SetError(error);
+  } else
+    sb_error.SetErrorString("invalid breakpoint");
+
+  return sb_error;
+}
+
+bool SBBreakpoint::AddName(const char *new_name) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (log)
+    log->Printf("SBBreakpoint(%p)::AddName (name=%s)",
+                static_cast<void *>(m_opaque_sp.get()), new_name);
+
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    Error error; // Think I'm just going to swallow the error here, it's
+                 // probably more annoying to have to provide it.
+    return m_opaque_sp->AddName(new_name, error);
+  }
+
+  return false;
+}
+
+void SBBreakpoint::RemoveName(const char *name_to_remove) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (log)
+    log->Printf("SBBreakpoint(%p)::RemoveName (name=%s)",
+                static_cast<void *>(m_opaque_sp.get()), name_to_remove);
+
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    m_opaque_sp->RemoveName(name_to_remove);
+  }
+}
+
+bool SBBreakpoint::MatchesName(const char *name) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (log)
+    log->Printf("SBBreakpoint(%p)::MatchesName (name=%s)",
+                static_cast<void *>(m_opaque_sp.get()), name);
+
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    return m_opaque_sp->MatchesName(name);
+  }
+
+  return false;
+}
+
+void SBBreakpoint::GetNames(SBStringList &names) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (log)
+    log->Printf("SBBreakpoint(%p)::GetNames ()",
+                static_cast<void *>(m_opaque_sp.get()));
+
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    std::vector<std::string> names_vec;
+    m_opaque_sp->GetNames(names_vec);
+    for (std::string name : names_vec) {
+      names.AppendString(name.c_str());
+    }
+  }
+}
+
+lldb_private::Breakpoint *SBBreakpoint::operator->() const {
+  return m_opaque_sp.get();
+}
+
+lldb_private::Breakpoint *SBBreakpoint::get() const {
+  return m_opaque_sp.get();
+}
+
+lldb::BreakpointSP &SBBreakpoint::operator*() { return m_opaque_sp; }
+
+const lldb::BreakpointSP &SBBreakpoint::operator*() const {
+  return m_opaque_sp;
+}
+
+bool SBBreakpoint::EventIsBreakpointEvent(const lldb::SBEvent &event) {
+  return Breakpoint::BreakpointEventData::GetEventDataFromEvent(event.get()) !=
+         nullptr;
 }
 
 BreakpointEventType
-SBBreakpoint::GetBreakpointEventTypeFromEvent (const SBEvent& event)
-{
-    if (event.IsValid())
-        return Breakpoint::BreakpointEventData::GetBreakpointEventTypeFromEvent (event.GetSP());
-    return eBreakpointEventTypeInvalidType;
+SBBreakpoint::GetBreakpointEventTypeFromEvent(const SBEvent &event) {
+  if (event.IsValid())
+    return Breakpoint::BreakpointEventData::GetBreakpointEventTypeFromEvent(
+        event.GetSP());
+  return eBreakpointEventTypeInvalidType;
 }
 
-SBBreakpoint
-SBBreakpoint::GetBreakpointFromEvent (const lldb::SBEvent& event)
-{
-    SBBreakpoint sb_breakpoint;
-    if (event.IsValid())
-        sb_breakpoint.m_opaque_sp = Breakpoint::BreakpointEventData::GetBreakpointFromEvent (event.GetSP());
-    return sb_breakpoint;
+SBBreakpoint SBBreakpoint::GetBreakpointFromEvent(const lldb::SBEvent &event) {
+  SBBreakpoint sb_breakpoint;
+  if (event.IsValid())
+    sb_breakpoint.m_opaque_sp =
+        Breakpoint::BreakpointEventData::GetBreakpointFromEvent(event.GetSP());
+  return sb_breakpoint;
 }
 
 SBBreakpointLocation
-SBBreakpoint::GetBreakpointLocationAtIndexFromEvent (const lldb::SBEvent& event, uint32_t loc_idx)
-{
-    SBBreakpointLocation sb_breakpoint_loc;
-    if (event.IsValid())
-        sb_breakpoint_loc.SetLocation (Breakpoint::BreakpointEventData::GetBreakpointLocationAtIndexFromEvent (event.GetSP(), loc_idx));
-    return sb_breakpoint_loc;
+SBBreakpoint::GetBreakpointLocationAtIndexFromEvent(const lldb::SBEvent &event,
+                                                    uint32_t loc_idx) {
+  SBBreakpointLocation sb_breakpoint_loc;
+  if (event.IsValid())
+    sb_breakpoint_loc.SetLocation(
+        Breakpoint::BreakpointEventData::GetBreakpointLocationAtIndexFromEvent(
+            event.GetSP(), loc_idx));
+  return sb_breakpoint_loc;
 }
 
 uint32_t
-SBBreakpoint::GetNumBreakpointLocationsFromEvent (const lldb::SBEvent &event)
-{
-    uint32_t num_locations = 0;
-    if (event.IsValid())
-        num_locations = (Breakpoint::BreakpointEventData::GetNumBreakpointLocationsFromEvent (event.GetSP()));
-    return num_locations;
+SBBreakpoint::GetNumBreakpointLocationsFromEvent(const lldb::SBEvent &event) {
+  uint32_t num_locations = 0;
+  if (event.IsValid())
+    num_locations =
+        (Breakpoint::BreakpointEventData::GetNumBreakpointLocationsFromEvent(
+            event.GetSP()));
+  return num_locations;
 }

Modified: lldb/trunk/source/API/SBBreakpointLocation.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBBreakpointLocation.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBBreakpointLocation.cpp (original)
+++ lldb/trunk/source/API/SBBreakpointLocation.cpp Tue Sep  6 15:57:50 2016
@@ -8,13 +8,11 @@
 //===----------------------------------------------------------------------===//
 
 #include "lldb/API/SBBreakpointLocation.h"
-#include "lldb/API/SBDefines.h"
 #include "lldb/API/SBAddress.h"
 #include "lldb/API/SBDebugger.h"
+#include "lldb/API/SBDefines.h"
 #include "lldb/API/SBStream.h"
 
-#include "lldb/lldb-types.h"
-#include "lldb/lldb-defines.h"
 #include "lldb/Breakpoint/Breakpoint.h"
 #include "lldb/Breakpoint/BreakpointLocation.h"
 #include "lldb/Core/Debugger.h"
@@ -23,347 +21,296 @@
 #include "lldb/Core/StreamFile.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Interpreter/ScriptInterpreter.h"
-#include "lldb/Target/ThreadSpec.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/ThreadSpec.h"
+#include "lldb/Target/ThreadSpec.h"
+#include "lldb/lldb-defines.h"
+#include "lldb/lldb-types.h"
 
 using namespace lldb;
 using namespace lldb_private;
 
+SBBreakpointLocation::SBBreakpointLocation() : m_opaque_sp() {}
+
+SBBreakpointLocation::SBBreakpointLocation(
+    const lldb::BreakpointLocationSP &break_loc_sp)
+    : m_opaque_sp(break_loc_sp) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-SBBreakpointLocation::SBBreakpointLocation () :
-    m_opaque_sp ()
-{
-}
-
-SBBreakpointLocation::SBBreakpointLocation (const lldb::BreakpointLocationSP &break_loc_sp) :
-    m_opaque_sp (break_loc_sp)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-    {
-        SBStream sstr;
-        GetDescription (sstr, lldb::eDescriptionLevelBrief);
-        log->Printf ("SBBreakpointLocation::SBBreakpointLocaiton (const lldb::BreakpointLocationsSP &break_loc_sp"
-                     "=%p)  => this.sp = %p (%s)",
-                     static_cast<void*>(break_loc_sp.get()),
-                     static_cast<void*>(m_opaque_sp.get()), sstr.GetData());
-    }
-}
-
-SBBreakpointLocation::SBBreakpointLocation(const SBBreakpointLocation &rhs) :
-    m_opaque_sp (rhs.m_opaque_sp)
-{
-}
-
-const SBBreakpointLocation &
-SBBreakpointLocation::operator = (const SBBreakpointLocation &rhs)
-{
-    if (this != &rhs)
-        m_opaque_sp = rhs.m_opaque_sp;
-    return *this;
-}
-
-
-SBBreakpointLocation::~SBBreakpointLocation ()
-{
-}
-
-bool
-SBBreakpointLocation::IsValid() const
-{
-    return m_opaque_sp.get() != NULL;
-}
-
-SBAddress
-SBBreakpointLocation::GetAddress ()
-{
-    if (m_opaque_sp)
-        return SBAddress(&m_opaque_sp->GetAddress());
-    else
-        return SBAddress();
-}
-
-addr_t
-SBBreakpointLocation::GetLoadAddress ()
-{
-    addr_t ret_addr = LLDB_INVALID_ADDRESS;
-
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        ret_addr = m_opaque_sp->GetLoadAddress();
-    }
-
-    return ret_addr;
-}
-
-void
-SBBreakpointLocation::SetEnabled (bool enabled)
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->SetEnabled (enabled);
-    }
-}
-
-bool
-SBBreakpointLocation::IsEnabled ()
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        return m_opaque_sp->IsEnabled();
-    }
-    else
-        return false;
-}
-
-uint32_t
-SBBreakpointLocation::GetIgnoreCount ()
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        return m_opaque_sp->GetIgnoreCount();
-    }
-    else
-        return 0;
-}
-
-void
-SBBreakpointLocation::SetIgnoreCount (uint32_t n)
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->SetIgnoreCount (n);
-    }
-}
-
-void
-SBBreakpointLocation::SetCondition (const char *condition)
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->SetCondition (condition);
-    }
-}
-
-const char *
-SBBreakpointLocation::GetCondition ()
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        return m_opaque_sp->GetConditionText ();
-    }
-    return NULL;
-}
-
-void
-SBBreakpointLocation::SetScriptCallbackFunction (const char *callback_function_name)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBBreakpointLocation(%p)::SetScriptCallbackFunction (callback=%s)",
-                     static_cast<void*>(m_opaque_sp.get()),
-                     callback_function_name);
-
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        BreakpointOptions *bp_options = m_opaque_sp->GetLocationOptions();
-        m_opaque_sp->GetBreakpoint().GetTarget().GetDebugger().GetCommandInterpreter().GetScriptInterpreter()->SetBreakpointCommandCallbackFunction (bp_options,
-                                                                                                                                     callback_function_name);
-    }
+  if (log) {
+    SBStream sstr;
+    GetDescription(sstr, lldb::eDescriptionLevelBrief);
+    log->Printf("SBBreakpointLocation::SBBreakpointLocaiton (const "
+                "lldb::BreakpointLocationsSP &break_loc_sp"
+                "=%p)  => this.sp = %p (%s)",
+                static_cast<void *>(break_loc_sp.get()),
+                static_cast<void *>(m_opaque_sp.get()), sstr.GetData());
+  }
 }
 
-SBError
-SBBreakpointLocation::SetScriptCallbackBody (const char *callback_body_text)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBBreakpoint(%p)::SetScriptCallbackBody: callback body:\n%s)",
-                     static_cast<void*>(m_opaque_sp.get()), callback_body_text);
-
-    SBError sb_error;
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        BreakpointOptions *bp_options = m_opaque_sp->GetLocationOptions();
-        Error error = m_opaque_sp->GetBreakpoint().GetTarget().GetDebugger().GetCommandInterpreter().GetScriptInterpreter()->SetBreakpointCommandCallback (bp_options,
-                                                                                                                                                           callback_body_text);
-        sb_error.SetError(error);
-    }
-    else
-        sb_error.SetErrorString("invalid breakpoint");
-
-    return sb_error;
-}
-
-void
-SBBreakpointLocation::SetThreadID (tid_t thread_id)
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->SetThreadID (thread_id);
-    }
-}
-
-tid_t
-SBBreakpointLocation::GetThreadID ()
-{
-    tid_t tid = LLDB_INVALID_THREAD_ID;
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        return m_opaque_sp->GetThreadID();
-    }
-    return tid;
-}
-
-void
-SBBreakpointLocation::SetThreadIndex (uint32_t index)
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->SetThreadIndex (index);
-    }
-}
-
-uint32_t
-SBBreakpointLocation::GetThreadIndex() const
-{
-    uint32_t thread_idx = UINT32_MAX;
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        return m_opaque_sp->GetThreadIndex();
-    }
-    return thread_idx;
-}
-    
-
-void
-SBBreakpointLocation::SetThreadName (const char *thread_name)
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->SetThreadName (thread_name);
-    }
-}
-
-const char *
-SBBreakpointLocation::GetThreadName () const
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        return m_opaque_sp->GetThreadName();
-    }
-    return NULL;
-}
-
-void
-SBBreakpointLocation::SetQueueName (const char *queue_name)
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->SetQueueName (queue_name);
-    }
-}
-
-const char *
-SBBreakpointLocation::GetQueueName () const
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->GetQueueName ();
-    }
-    return NULL;
-}
-
-bool
-SBBreakpointLocation::IsResolved ()
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        return m_opaque_sp->IsResolved();
-    }
+SBBreakpointLocation::SBBreakpointLocation(const SBBreakpointLocation &rhs)
+    : m_opaque_sp(rhs.m_opaque_sp) {}
+
+const SBBreakpointLocation &SBBreakpointLocation::
+operator=(const SBBreakpointLocation &rhs) {
+  if (this != &rhs)
+    m_opaque_sp = rhs.m_opaque_sp;
+  return *this;
+}
+
+SBBreakpointLocation::~SBBreakpointLocation() {}
+
+bool SBBreakpointLocation::IsValid() const { return m_opaque_sp.get() != NULL; }
+
+SBAddress SBBreakpointLocation::GetAddress() {
+  if (m_opaque_sp)
+    return SBAddress(&m_opaque_sp->GetAddress());
+  else
+    return SBAddress();
+}
+
+addr_t SBBreakpointLocation::GetLoadAddress() {
+  addr_t ret_addr = LLDB_INVALID_ADDRESS;
+
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    ret_addr = m_opaque_sp->GetLoadAddress();
+  }
+
+  return ret_addr;
+}
+
+void SBBreakpointLocation::SetEnabled(bool enabled) {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    m_opaque_sp->SetEnabled(enabled);
+  }
+}
+
+bool SBBreakpointLocation::IsEnabled() {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    return m_opaque_sp->IsEnabled();
+  } else
     return false;
 }
 
-void
-SBBreakpointLocation::SetLocation (const lldb::BreakpointLocationSP &break_loc_sp)
-{
-    // Uninstall the callbacks?
-    m_opaque_sp = break_loc_sp;
-}
-
-bool
-SBBreakpointLocation::GetDescription (SBStream &description, DescriptionLevel level)
-{
-    Stream &strm = description.ref();
-
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        m_opaque_sp->GetDescription (&strm, level);
-        strm.EOL();
-    }
-    else
-        strm.PutCString ("No value");
-
-    return true;
-}
-
-break_id_t
-SBBreakpointLocation::GetID ()
-{
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        return m_opaque_sp->GetID ();
-    }
-    else
-        return LLDB_INVALID_BREAK_ID;
-}
-
-SBBreakpoint
-SBBreakpointLocation::GetBreakpoint ()
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    //if (log)
-    //    log->Printf ("SBBreakpointLocation::GetBreakpoint ()");
-
-    SBBreakpoint sb_bp;
-    if (m_opaque_sp)
-    {
-        std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
-        *sb_bp = m_opaque_sp->GetBreakpoint ().shared_from_this();
-    }
-
-    if (log)
-    {
-        SBStream sstr;
-        sb_bp.GetDescription (sstr);
-        log->Printf ("SBBreakpointLocation(%p)::GetBreakpoint () => SBBreakpoint(%p) %s",
-                     static_cast<void*>(m_opaque_sp.get()),
-                     static_cast<void*>(sb_bp.get()), sstr.GetData());
-    }
-    return sb_bp;
+uint32_t SBBreakpointLocation::GetIgnoreCount() {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    return m_opaque_sp->GetIgnoreCount();
+  } else
+    return 0;
+}
+
+void SBBreakpointLocation::SetIgnoreCount(uint32_t n) {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    m_opaque_sp->SetIgnoreCount(n);
+  }
+}
+
+void SBBreakpointLocation::SetCondition(const char *condition) {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    m_opaque_sp->SetCondition(condition);
+  }
+}
+
+const char *SBBreakpointLocation::GetCondition() {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    return m_opaque_sp->GetConditionText();
+  }
+  return NULL;
+}
+
+void SBBreakpointLocation::SetScriptCallbackFunction(
+    const char *callback_function_name) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (log)
+    log->Printf(
+        "SBBreakpointLocation(%p)::SetScriptCallbackFunction (callback=%s)",
+        static_cast<void *>(m_opaque_sp.get()), callback_function_name);
+
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    BreakpointOptions *bp_options = m_opaque_sp->GetLocationOptions();
+    m_opaque_sp->GetBreakpoint()
+        .GetTarget()
+        .GetDebugger()
+        .GetCommandInterpreter()
+        .GetScriptInterpreter()
+        ->SetBreakpointCommandCallbackFunction(bp_options,
+                                               callback_function_name);
+  }
 }
 
+SBError
+SBBreakpointLocation::SetScriptCallbackBody(const char *callback_body_text) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (log)
+    log->Printf("SBBreakpoint(%p)::SetScriptCallbackBody: callback body:\n%s)",
+                static_cast<void *>(m_opaque_sp.get()), callback_body_text);
+
+  SBError sb_error;
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    BreakpointOptions *bp_options = m_opaque_sp->GetLocationOptions();
+    Error error =
+        m_opaque_sp->GetBreakpoint()
+            .GetTarget()
+            .GetDebugger()
+            .GetCommandInterpreter()
+            .GetScriptInterpreter()
+            ->SetBreakpointCommandCallback(bp_options, callback_body_text);
+    sb_error.SetError(error);
+  } else
+    sb_error.SetErrorString("invalid breakpoint");
+
+  return sb_error;
+}
+
+void SBBreakpointLocation::SetThreadID(tid_t thread_id) {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    m_opaque_sp->SetThreadID(thread_id);
+  }
+}
+
+tid_t SBBreakpointLocation::GetThreadID() {
+  tid_t tid = LLDB_INVALID_THREAD_ID;
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    return m_opaque_sp->GetThreadID();
+  }
+  return tid;
+}
+
+void SBBreakpointLocation::SetThreadIndex(uint32_t index) {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    m_opaque_sp->SetThreadIndex(index);
+  }
+}
+
+uint32_t SBBreakpointLocation::GetThreadIndex() const {
+  uint32_t thread_idx = UINT32_MAX;
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    return m_opaque_sp->GetThreadIndex();
+  }
+  return thread_idx;
+}
+
+void SBBreakpointLocation::SetThreadName(const char *thread_name) {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    m_opaque_sp->SetThreadName(thread_name);
+  }
+}
+
+const char *SBBreakpointLocation::GetThreadName() const {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    return m_opaque_sp->GetThreadName();
+  }
+  return NULL;
+}
+
+void SBBreakpointLocation::SetQueueName(const char *queue_name) {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    m_opaque_sp->SetQueueName(queue_name);
+  }
+}
+
+const char *SBBreakpointLocation::GetQueueName() const {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    m_opaque_sp->GetQueueName();
+  }
+  return NULL;
+}
+
+bool SBBreakpointLocation::IsResolved() {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    return m_opaque_sp->IsResolved();
+  }
+  return false;
+}
+
+void SBBreakpointLocation::SetLocation(
+    const lldb::BreakpointLocationSP &break_loc_sp) {
+  // Uninstall the callbacks?
+  m_opaque_sp = break_loc_sp;
+}
+
+bool SBBreakpointLocation::GetDescription(SBStream &description,
+                                          DescriptionLevel level) {
+  Stream &strm = description.ref();
+
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    m_opaque_sp->GetDescription(&strm, level);
+    strm.EOL();
+  } else
+    strm.PutCString("No value");
+
+  return true;
+}
+
+break_id_t SBBreakpointLocation::GetID() {
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    return m_opaque_sp->GetID();
+  } else
+    return LLDB_INVALID_BREAK_ID;
+}
+
+SBBreakpoint SBBreakpointLocation::GetBreakpoint() {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  // if (log)
+  //    log->Printf ("SBBreakpointLocation::GetBreakpoint ()");
+
+  SBBreakpoint sb_bp;
+  if (m_opaque_sp) {
+    std::lock_guard<std::recursive_mutex> guard(
+        m_opaque_sp->GetTarget().GetAPIMutex());
+    *sb_bp = m_opaque_sp->GetBreakpoint().shared_from_this();
+  }
+
+  if (log) {
+    SBStream sstr;
+    sb_bp.GetDescription(sstr);
+    log->Printf(
+        "SBBreakpointLocation(%p)::GetBreakpoint () => SBBreakpoint(%p) %s",
+        static_cast<void *>(m_opaque_sp.get()),
+        static_cast<void *>(sb_bp.get()), sstr.GetData());
+  }
+  return sb_bp;
+}

Modified: lldb/trunk/source/API/SBBroadcaster.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBBroadcaster.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBBroadcaster.cpp (original)
+++ lldb/trunk/source/API/SBBroadcaster.cpp Tue Sep  6 15:57:50 2016
@@ -11,192 +11,151 @@
 #include "lldb/Core/Log.h"
 
 #include "lldb/API/SBBroadcaster.h"
-#include "lldb/API/SBListener.h"
 #include "lldb/API/SBEvent.h"
+#include "lldb/API/SBListener.h"
 
 using namespace lldb;
 using namespace lldb_private;
 
+SBBroadcaster::SBBroadcaster() : m_opaque_sp(), m_opaque_ptr(NULL) {}
 
-SBBroadcaster::SBBroadcaster () :
-    m_opaque_sp (),
-    m_opaque_ptr (NULL)
-{
-}
-
-SBBroadcaster::SBBroadcaster (const char *name) :
-    m_opaque_sp (new Broadcaster (NULL, name)),
-    m_opaque_ptr (NULL)
-{
-    m_opaque_ptr = m_opaque_sp.get();
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE));
+SBBroadcaster::SBBroadcaster(const char *name)
+    : m_opaque_sp(new Broadcaster(NULL, name)), m_opaque_ptr(NULL) {
+  m_opaque_ptr = m_opaque_sp.get();
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API |
+                                                  LIBLLDB_LOG_VERBOSE));
 
-    if (log)
-        log->Printf ("SBBroadcaster::SBBroadcaster (name=\"%s\") => SBBroadcaster(%p)",
-                     name, static_cast<void*>(m_opaque_ptr));
+  if (log)
+    log->Printf(
+        "SBBroadcaster::SBBroadcaster (name=\"%s\") => SBBroadcaster(%p)", name,
+        static_cast<void *>(m_opaque_ptr));
 }
 
-SBBroadcaster::SBBroadcaster (lldb_private::Broadcaster *broadcaster, bool owns) :
-    m_opaque_sp (owns ? broadcaster : NULL),
-    m_opaque_ptr (broadcaster)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE));
+SBBroadcaster::SBBroadcaster(lldb_private::Broadcaster *broadcaster, bool owns)
+    : m_opaque_sp(owns ? broadcaster : NULL), m_opaque_ptr(broadcaster) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API |
+                                                  LIBLLDB_LOG_VERBOSE));
 
-    if (log)
-        log->Printf ("SBBroadcaster::SBBroadcaster (broadcaster=%p, bool owns=%i) => SBBroadcaster(%p)",
-                     static_cast<void*>(broadcaster), owns,
-                     static_cast<void*>(m_opaque_ptr));
+  if (log)
+    log->Printf("SBBroadcaster::SBBroadcaster (broadcaster=%p, bool owns=%i) "
+                "=> SBBroadcaster(%p)",
+                static_cast<void *>(broadcaster), owns,
+                static_cast<void *>(m_opaque_ptr));
 }
 
-SBBroadcaster::SBBroadcaster (const SBBroadcaster &rhs) :
-    m_opaque_sp (rhs.m_opaque_sp),
-    m_opaque_ptr (rhs.m_opaque_ptr) 
-{
-}
+SBBroadcaster::SBBroadcaster(const SBBroadcaster &rhs)
+    : m_opaque_sp(rhs.m_opaque_sp), m_opaque_ptr(rhs.m_opaque_ptr) {}
 
-const SBBroadcaster &
-SBBroadcaster::operator = (const SBBroadcaster &rhs)
-{
-    if (this != &rhs)
-    {
-        m_opaque_sp = rhs.m_opaque_sp;
-        m_opaque_ptr = rhs.m_opaque_ptr;
-    }
-    return *this;
+const SBBroadcaster &SBBroadcaster::operator=(const SBBroadcaster &rhs) {
+  if (this != &rhs) {
+    m_opaque_sp = rhs.m_opaque_sp;
+    m_opaque_ptr = rhs.m_opaque_ptr;
+  }
+  return *this;
 }
 
-SBBroadcaster::~SBBroadcaster()
-{
-    reset (NULL, false);
-}
+SBBroadcaster::~SBBroadcaster() { reset(NULL, false); }
 
-void
-SBBroadcaster::BroadcastEventByType (uint32_t event_type, bool unique)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+void SBBroadcaster::BroadcastEventByType(uint32_t event_type, bool unique) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-    if (log)
-        log->Printf ("SBBroadcaster(%p)::BroadcastEventByType (event_type=0x%8.8x, unique=%i)",
-                     static_cast<void*>(m_opaque_ptr), event_type, unique);
+  if (log)
+    log->Printf("SBBroadcaster(%p)::BroadcastEventByType (event_type=0x%8.8x, "
+                "unique=%i)",
+                static_cast<void *>(m_opaque_ptr), event_type, unique);
 
-    if (m_opaque_ptr == NULL)
-        return;
+  if (m_opaque_ptr == NULL)
+    return;
 
-    if (unique)
-        m_opaque_ptr->BroadcastEventIfUnique (event_type);
-    else
-        m_opaque_ptr->BroadcastEvent (event_type);
+  if (unique)
+    m_opaque_ptr->BroadcastEventIfUnique(event_type);
+  else
+    m_opaque_ptr->BroadcastEvent(event_type);
 }
 
-void
-SBBroadcaster::BroadcastEvent (const SBEvent &event, bool unique)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+void SBBroadcaster::BroadcastEvent(const SBEvent &event, bool unique) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-    if (log)
-        log->Printf ("SBBroadcaster(%p)::BroadcastEventByType (SBEvent(%p), unique=%i)",
-                     static_cast<void*>(m_opaque_ptr),
-                     static_cast<void*>(event.get()), unique);
+  if (log)
+    log->Printf(
+        "SBBroadcaster(%p)::BroadcastEventByType (SBEvent(%p), unique=%i)",
+        static_cast<void *>(m_opaque_ptr), static_cast<void *>(event.get()),
+        unique);
 
-    if (m_opaque_ptr == NULL)
-        return;
+  if (m_opaque_ptr == NULL)
+    return;
 
-    EventSP event_sp = event.GetSP ();
-    if (unique)
-        m_opaque_ptr->BroadcastEventIfUnique (event_sp);
-    else
-        m_opaque_ptr->BroadcastEvent (event_sp);
+  EventSP event_sp = event.GetSP();
+  if (unique)
+    m_opaque_ptr->BroadcastEventIfUnique(event_sp);
+  else
+    m_opaque_ptr->BroadcastEvent(event_sp);
 }
 
-void
-SBBroadcaster::AddInitialEventsToListener (const SBListener &listener, uint32_t requested_events)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBBroadcaster(%p)::AddInitialEventsToListener (SBListener(%p), event_mask=0x%8.8x)",
-                     static_cast<void*>(m_opaque_ptr),
-                     static_cast<void*>(listener.get()), requested_events);
-    if (m_opaque_ptr)
-        m_opaque_ptr->AddInitialEventsToListener (listener.m_opaque_sp, requested_events);
+void SBBroadcaster::AddInitialEventsToListener(const SBListener &listener,
+                                               uint32_t requested_events) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBBroadcaster(%p)::AddInitialEventsToListener "
+                "(SBListener(%p), event_mask=0x%8.8x)",
+                static_cast<void *>(m_opaque_ptr),
+                static_cast<void *>(listener.get()), requested_events);
+  if (m_opaque_ptr)
+    m_opaque_ptr->AddInitialEventsToListener(listener.m_opaque_sp,
+                                             requested_events);
 }
 
-uint32_t
-SBBroadcaster::AddListener (const SBListener &listener, uint32_t event_mask)
-{
-    if (m_opaque_ptr)
-        return m_opaque_ptr->AddListener (listener.m_opaque_sp, event_mask);
-    return 0;
+uint32_t SBBroadcaster::AddListener(const SBListener &listener,
+                                    uint32_t event_mask) {
+  if (m_opaque_ptr)
+    return m_opaque_ptr->AddListener(listener.m_opaque_sp, event_mask);
+  return 0;
 }
 
-const char *
-SBBroadcaster::GetName () const
-{
-    if (m_opaque_ptr)
-        return m_opaque_ptr->GetBroadcasterName().GetCString();
-    return NULL;
+const char *SBBroadcaster::GetName() const {
+  if (m_opaque_ptr)
+    return m_opaque_ptr->GetBroadcasterName().GetCString();
+  return NULL;
 }
 
-bool
-SBBroadcaster::EventTypeHasListeners (uint32_t event_type)
-{
-    if (m_opaque_ptr)
-        return m_opaque_ptr->EventTypeHasListeners (event_type);
-    return false;
+bool SBBroadcaster::EventTypeHasListeners(uint32_t event_type) {
+  if (m_opaque_ptr)
+    return m_opaque_ptr->EventTypeHasListeners(event_type);
+  return false;
 }
 
-bool
-SBBroadcaster::RemoveListener (const SBListener &listener, uint32_t event_mask)
-{
-    if (m_opaque_ptr)
-        return m_opaque_ptr->RemoveListener (listener.m_opaque_sp, event_mask);
-    return false;
+bool SBBroadcaster::RemoveListener(const SBListener &listener,
+                                   uint32_t event_mask) {
+  if (m_opaque_ptr)
+    return m_opaque_ptr->RemoveListener(listener.m_opaque_sp, event_mask);
+  return false;
 }
 
-Broadcaster *
-SBBroadcaster::get () const
-{
-    return m_opaque_ptr;
-}
+Broadcaster *SBBroadcaster::get() const { return m_opaque_ptr; }
 
-void
-SBBroadcaster::reset (Broadcaster *broadcaster, bool owns)
-{
-    if (owns)
-        m_opaque_sp.reset (broadcaster);
-    else
-        m_opaque_sp.reset ();
-    m_opaque_ptr = broadcaster;
+void SBBroadcaster::reset(Broadcaster *broadcaster, bool owns) {
+  if (owns)
+    m_opaque_sp.reset(broadcaster);
+  else
+    m_opaque_sp.reset();
+  m_opaque_ptr = broadcaster;
 }
 
+bool SBBroadcaster::IsValid() const { return m_opaque_ptr != NULL; }
 
-bool
-SBBroadcaster::IsValid () const
-{
-    return m_opaque_ptr != NULL;
-}
-
-void
-SBBroadcaster::Clear ()
-{
-    m_opaque_sp.reset();
-    m_opaque_ptr = NULL;
+void SBBroadcaster::Clear() {
+  m_opaque_sp.reset();
+  m_opaque_ptr = NULL;
 }
 
-bool
-SBBroadcaster::operator == (const SBBroadcaster &rhs) const
-{
-    return m_opaque_ptr == rhs.m_opaque_ptr;
-    
+bool SBBroadcaster::operator==(const SBBroadcaster &rhs) const {
+  return m_opaque_ptr == rhs.m_opaque_ptr;
 }
 
-bool
-SBBroadcaster::operator != (const SBBroadcaster &rhs) const
-{
-    return m_opaque_ptr != rhs.m_opaque_ptr;
+bool SBBroadcaster::operator!=(const SBBroadcaster &rhs) const {
+  return m_opaque_ptr != rhs.m_opaque_ptr;
 }
 
-bool
-SBBroadcaster::operator < (const SBBroadcaster &rhs) const
-{
-    return m_opaque_ptr < rhs.m_opaque_ptr;
+bool SBBroadcaster::operator<(const SBBroadcaster &rhs) const {
+  return m_opaque_ptr < rhs.m_opaque_ptr;
 }

Modified: lldb/trunk/source/API/SBCommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCommandInterpreter.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBCommandInterpreter.cpp (original)
+++ lldb/trunk/source/API/SBCommandInterpreter.cpp Tue Sep  6 15:57:50 2016
@@ -20,698 +20,595 @@
 #include "lldb/Target/Target.h"
 
 #include "lldb/API/SBBroadcaster.h"
-#include "lldb/API/SBCommandReturnObject.h"
 #include "lldb/API/SBCommandInterpreter.h"
+#include "lldb/API/SBCommandReturnObject.h"
 #include "lldb/API/SBEvent.h"
 #include "lldb/API/SBExecutionContext.h"
-#include "lldb/API/SBProcess.h"
-#include "lldb/API/SBTarget.h"
 #include "lldb/API/SBListener.h"
+#include "lldb/API/SBProcess.h"
 #include "lldb/API/SBStream.h"
 #include "lldb/API/SBStringList.h"
+#include "lldb/API/SBTarget.h"
 
 using namespace lldb;
 using namespace lldb_private;
 
-SBCommandInterpreterRunOptions::SBCommandInterpreterRunOptions()
-{
-    m_opaque_up.reset(new CommandInterpreterRunOptions());
+SBCommandInterpreterRunOptions::SBCommandInterpreterRunOptions() {
+  m_opaque_up.reset(new CommandInterpreterRunOptions());
 }
 
 SBCommandInterpreterRunOptions::~SBCommandInterpreterRunOptions() = default;
 
-bool
-SBCommandInterpreterRunOptions::GetStopOnContinue () const
-{
-    return m_opaque_up->GetStopOnContinue();
+bool SBCommandInterpreterRunOptions::GetStopOnContinue() const {
+  return m_opaque_up->GetStopOnContinue();
 }
 
-void
-SBCommandInterpreterRunOptions::SetStopOnContinue (bool stop_on_continue)
-{
-    m_opaque_up->SetStopOnContinue(stop_on_continue);
+void SBCommandInterpreterRunOptions::SetStopOnContinue(bool stop_on_continue) {
+  m_opaque_up->SetStopOnContinue(stop_on_continue);
 }
 
-bool
-SBCommandInterpreterRunOptions::GetStopOnError () const
-{
-    return m_opaque_up->GetStopOnError();
+bool SBCommandInterpreterRunOptions::GetStopOnError() const {
+  return m_opaque_up->GetStopOnError();
 }
 
-void
-SBCommandInterpreterRunOptions::SetStopOnError (bool stop_on_error)
-{
-    m_opaque_up->SetStopOnError(stop_on_error);
+void SBCommandInterpreterRunOptions::SetStopOnError(bool stop_on_error) {
+  m_opaque_up->SetStopOnError(stop_on_error);
 }
 
-bool
-SBCommandInterpreterRunOptions::GetStopOnCrash () const
-{
-    return m_opaque_up->GetStopOnCrash();
+bool SBCommandInterpreterRunOptions::GetStopOnCrash() const {
+  return m_opaque_up->GetStopOnCrash();
 }
 
-void
-SBCommandInterpreterRunOptions::SetStopOnCrash (bool stop_on_crash)
-{
-    m_opaque_up->SetStopOnCrash(stop_on_crash);
+void SBCommandInterpreterRunOptions::SetStopOnCrash(bool stop_on_crash) {
+  m_opaque_up->SetStopOnCrash(stop_on_crash);
 }
 
-bool
-SBCommandInterpreterRunOptions::GetEchoCommands () const
-{
-    return m_opaque_up->GetEchoCommands();
+bool SBCommandInterpreterRunOptions::GetEchoCommands() const {
+  return m_opaque_up->GetEchoCommands();
 }
 
-void
-SBCommandInterpreterRunOptions::SetEchoCommands (bool echo_commands)
-{
-    m_opaque_up->SetEchoCommands(echo_commands);
+void SBCommandInterpreterRunOptions::SetEchoCommands(bool echo_commands) {
+  m_opaque_up->SetEchoCommands(echo_commands);
 }
 
-bool
-SBCommandInterpreterRunOptions::GetPrintResults () const
-{
-    return m_opaque_up->GetPrintResults();
+bool SBCommandInterpreterRunOptions::GetPrintResults() const {
+  return m_opaque_up->GetPrintResults();
 }
 
-void
-SBCommandInterpreterRunOptions::SetPrintResults (bool print_results)
-{
-    m_opaque_up->SetPrintResults(print_results);
+void SBCommandInterpreterRunOptions::SetPrintResults(bool print_results) {
+  m_opaque_up->SetPrintResults(print_results);
 }
 
-bool
-SBCommandInterpreterRunOptions::GetAddToHistory () const
-{
-    return m_opaque_up->GetAddToHistory();
+bool SBCommandInterpreterRunOptions::GetAddToHistory() const {
+  return m_opaque_up->GetAddToHistory();
 }
 
-void
-SBCommandInterpreterRunOptions::SetAddToHistory (bool add_to_history)
-{
-    m_opaque_up->SetAddToHistory(add_to_history);
+void SBCommandInterpreterRunOptions::SetAddToHistory(bool add_to_history) {
+  m_opaque_up->SetAddToHistory(add_to_history);
 }
 
 lldb_private::CommandInterpreterRunOptions *
-SBCommandInterpreterRunOptions::get () const
-{
-    return m_opaque_up.get();
+SBCommandInterpreterRunOptions::get() const {
+  return m_opaque_up.get();
 }
 
 lldb_private::CommandInterpreterRunOptions &
-SBCommandInterpreterRunOptions::ref () const
-{
-    return *m_opaque_up.get();
+SBCommandInterpreterRunOptions::ref() const {
+  return *m_opaque_up.get();
 }
 
-class CommandPluginInterfaceImplementation : public CommandObjectParsed
-{
+class CommandPluginInterfaceImplementation : public CommandObjectParsed {
 public:
-    CommandPluginInterfaceImplementation(CommandInterpreter &interpreter,
-                                         const char *name,
-                                         lldb::SBCommandPluginInterface* backend,
-                                         const char *help = nullptr,
-                                         const char *syntax = nullptr,
-                                         uint32_t flags = 0) :
-    CommandObjectParsed (interpreter, name, help, syntax, flags),
-    m_backend(backend) {}
-    
-    bool
-    IsRemovable() const override
-    {
-        return true;
-    }
-    
+  CommandPluginInterfaceImplementation(CommandInterpreter &interpreter,
+                                       const char *name,
+                                       lldb::SBCommandPluginInterface *backend,
+                                       const char *help = nullptr,
+                                       const char *syntax = nullptr,
+                                       uint32_t flags = 0)
+      : CommandObjectParsed(interpreter, name, help, syntax, flags),
+        m_backend(backend) {}
+
+  bool IsRemovable() const override { return true; }
+
 protected:
-    bool
-    DoExecute(Args& command, CommandReturnObject &result) override
-    {
-        SBCommandReturnObject sb_return(&result);
-        SBCommandInterpreter sb_interpreter(&m_interpreter);
-        SBDebugger debugger_sb(m_interpreter.GetDebugger().shared_from_this());
-        bool ret = m_backend->DoExecute (debugger_sb,(char**)command.GetArgumentVector(), sb_return);
-        sb_return.Release();
-        return ret;
-    }
-    std::shared_ptr<lldb::SBCommandPluginInterface> m_backend;
+  bool DoExecute(Args &command, CommandReturnObject &result) override {
+    SBCommandReturnObject sb_return(&result);
+    SBCommandInterpreter sb_interpreter(&m_interpreter);
+    SBDebugger debugger_sb(m_interpreter.GetDebugger().shared_from_this());
+    bool ret = m_backend->DoExecute(
+        debugger_sb, (char **)command.GetArgumentVector(), sb_return);
+    sb_return.Release();
+    return ret;
+  }
+  std::shared_ptr<lldb::SBCommandPluginInterface> m_backend;
 };
 
-SBCommandInterpreter::SBCommandInterpreter (CommandInterpreter *interpreter) :
-    m_opaque_ptr (interpreter)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBCommandInterpreter::SBCommandInterpreter (interpreter=%p)"
-                     " => SBCommandInterpreter(%p)",
-                     static_cast<void*>(interpreter),
-                     static_cast<void*>(m_opaque_ptr));
+SBCommandInterpreter::SBCommandInterpreter(CommandInterpreter *interpreter)
+    : m_opaque_ptr(interpreter) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (log)
+    log->Printf("SBCommandInterpreter::SBCommandInterpreter (interpreter=%p)"
+                " => SBCommandInterpreter(%p)",
+                static_cast<void *>(interpreter),
+                static_cast<void *>(m_opaque_ptr));
 }
 
-SBCommandInterpreter::SBCommandInterpreter(const SBCommandInterpreter &rhs) :
-    m_opaque_ptr (rhs.m_opaque_ptr)
-{
-}
+SBCommandInterpreter::SBCommandInterpreter(const SBCommandInterpreter &rhs)
+    : m_opaque_ptr(rhs.m_opaque_ptr) {}
 
 SBCommandInterpreter::~SBCommandInterpreter() = default;
 
-const SBCommandInterpreter &
-SBCommandInterpreter::operator = (const SBCommandInterpreter &rhs)
-{
-    m_opaque_ptr = rhs.m_opaque_ptr;
-    return *this;
-}
-
-bool
-SBCommandInterpreter::IsValid() const
-{
-    return m_opaque_ptr != nullptr;
+const SBCommandInterpreter &SBCommandInterpreter::
+operator=(const SBCommandInterpreter &rhs) {
+  m_opaque_ptr = rhs.m_opaque_ptr;
+  return *this;
 }
 
-bool
-SBCommandInterpreter::CommandExists(const char *cmd)
-{
-    return (((cmd != nullptr) && IsValid()) ? m_opaque_ptr->CommandExists(cmd) : false);
-}
+bool SBCommandInterpreter::IsValid() const { return m_opaque_ptr != nullptr; }
 
-bool
-SBCommandInterpreter::AliasExists (const char *cmd)
-{
-    return (((cmd != nullptr) && IsValid()) ? m_opaque_ptr->AliasExists(cmd) : false);
+bool SBCommandInterpreter::CommandExists(const char *cmd) {
+  return (((cmd != nullptr) && IsValid()) ? m_opaque_ptr->CommandExists(cmd)
+                                          : false);
 }
 
-bool
-SBCommandInterpreter::IsActive()
-{
-    return (IsValid() ? m_opaque_ptr->IsActive() : false);
+bool SBCommandInterpreter::AliasExists(const char *cmd) {
+  return (((cmd != nullptr) && IsValid()) ? m_opaque_ptr->AliasExists(cmd)
+                                          : false);
 }
 
-const char *
-SBCommandInterpreter::GetIOHandlerControlSequence(char ch)
-{
-    return (IsValid() ? m_opaque_ptr->GetDebugger().GetTopIOHandlerControlSequence(ch).GetCString() : nullptr);
+bool SBCommandInterpreter::IsActive() {
+  return (IsValid() ? m_opaque_ptr->IsActive() : false);
 }
 
-lldb::ReturnStatus
-SBCommandInterpreter::HandleCommand (const char *command_line, SBCommandReturnObject &result, bool add_to_history)
-{
-    SBExecutionContext sb_exe_ctx;
-    return HandleCommand (command_line, sb_exe_ctx, result, add_to_history);
+const char *SBCommandInterpreter::GetIOHandlerControlSequence(char ch) {
+  return (IsValid()
+              ? m_opaque_ptr->GetDebugger()
+                    .GetTopIOHandlerControlSequence(ch)
+                    .GetCString()
+              : nullptr);
 }
 
 lldb::ReturnStatus
-SBCommandInterpreter::HandleCommand (const char *command_line, SBExecutionContext &override_context, SBCommandReturnObject &result, bool add_to_history)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBCommandInterpreter(%p)::HandleCommand (command=\"%s\", SBCommandReturnObject(%p), add_to_history=%i)",
-                     static_cast<void*>(m_opaque_ptr), command_line,
-                     static_cast<void*>(result.get()), add_to_history);
-
-    ExecutionContext ctx, *ctx_ptr;
-    if (override_context.get())
-    {
-        ctx = override_context.get()->Lock(true);
-        ctx_ptr = &ctx;
-    }
-    else
-       ctx_ptr = nullptr;
-
-
-    result.Clear();
-    if (command_line && IsValid())
-    {
-        result.ref().SetInteractive(false);
-        m_opaque_ptr->HandleCommand (command_line, add_to_history ? eLazyBoolYes : eLazyBoolNo, result.ref(), ctx_ptr);
-    }
-    else
-    {
-        result->AppendError ("SBCommandInterpreter or the command line is not valid");
-        result->SetStatus (eReturnStatusFailed);
-    }
-
-    // We need to get the value again, in case the command disabled the log!
-    log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-    if (log)
-    {
-        SBStream sstr;
-        result.GetDescription (sstr);
-        log->Printf ("SBCommandInterpreter(%p)::HandleCommand (command=\"%s\", SBCommandReturnObject(%p): %s, add_to_history=%i) => %i", 
-                     static_cast<void*>(m_opaque_ptr), command_line,
-                     static_cast<void*>(result.get()), sstr.GetData(),
-                     add_to_history, result.GetStatus());
-    }
-
-    return result.GetStatus();
+SBCommandInterpreter::HandleCommand(const char *command_line,
+                                    SBCommandReturnObject &result,
+                                    bool add_to_history) {
+  SBExecutionContext sb_exe_ctx;
+  return HandleCommand(command_line, sb_exe_ctx, result, add_to_history);
+}
+
+lldb::ReturnStatus SBCommandInterpreter::HandleCommand(
+    const char *command_line, SBExecutionContext &override_context,
+    SBCommandReturnObject &result, bool add_to_history) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (log)
+    log->Printf("SBCommandInterpreter(%p)::HandleCommand (command=\"%s\", "
+                "SBCommandReturnObject(%p), add_to_history=%i)",
+                static_cast<void *>(m_opaque_ptr), command_line,
+                static_cast<void *>(result.get()), add_to_history);
+
+  ExecutionContext ctx, *ctx_ptr;
+  if (override_context.get()) {
+    ctx = override_context.get()->Lock(true);
+    ctx_ptr = &ctx;
+  } else
+    ctx_ptr = nullptr;
+
+  result.Clear();
+  if (command_line && IsValid()) {
+    result.ref().SetInteractive(false);
+    m_opaque_ptr->HandleCommand(command_line,
+                                add_to_history ? eLazyBoolYes : eLazyBoolNo,
+                                result.ref(), ctx_ptr);
+  } else {
+    result->AppendError(
+        "SBCommandInterpreter or the command line is not valid");
+    result->SetStatus(eReturnStatusFailed);
+  }
+
+  // We need to get the value again, in case the command disabled the log!
+  log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API);
+  if (log) {
+    SBStream sstr;
+    result.GetDescription(sstr);
+    log->Printf("SBCommandInterpreter(%p)::HandleCommand (command=\"%s\", "
+                "SBCommandReturnObject(%p): %s, add_to_history=%i) => %i",
+                static_cast<void *>(m_opaque_ptr), command_line,
+                static_cast<void *>(result.get()), sstr.GetData(),
+                add_to_history, result.GetStatus());
+  }
+
+  return result.GetStatus();
+}
+
+void SBCommandInterpreter::HandleCommandsFromFile(
+    lldb::SBFileSpec &file, lldb::SBExecutionContext &override_context,
+    lldb::SBCommandInterpreterRunOptions &options,
+    lldb::SBCommandReturnObject result) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (log) {
+    SBStream s;
+    file.GetDescription(s);
+    log->Printf("SBCommandInterpreter(%p)::HandleCommandsFromFile "
+                "(file=\"%s\", SBCommandReturnObject(%p))",
+                static_cast<void *>(m_opaque_ptr), s.GetData(),
+                static_cast<void *>(result.get()));
+  }
+
+  if (!IsValid()) {
+    result->AppendError("SBCommandInterpreter is not valid.");
+    result->SetStatus(eReturnStatusFailed);
+    return;
+  }
+
+  if (!file.IsValid()) {
+    SBStream s;
+    file.GetDescription(s);
+    result->AppendErrorWithFormat("File is not valid: %s.", s.GetData());
+    result->SetStatus(eReturnStatusFailed);
+  }
+
+  FileSpec tmp_spec = file.ref();
+  ExecutionContext ctx, *ctx_ptr;
+  if (override_context.get()) {
+    ctx = override_context.get()->Lock(true);
+    ctx_ptr = &ctx;
+  } else
+    ctx_ptr = nullptr;
+
+  m_opaque_ptr->HandleCommandsFromFile(tmp_spec, ctx_ptr, options.ref(),
+                                       result.ref());
+}
+
+int SBCommandInterpreter::HandleCompletion(
+    const char *current_line, const char *cursor, const char *last_char,
+    int match_start_point, int max_return_elements, SBStringList &matches) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  int num_completions = 0;
+
+  // Sanity check the arguments that are passed in:
+  // cursor & last_char have to be within the current_line.
+  if (current_line == nullptr || cursor == nullptr || last_char == nullptr)
+    return 0;
+
+  if (cursor < current_line || last_char < current_line)
+    return 0;
+
+  size_t current_line_size = strlen(current_line);
+  if (cursor - current_line > static_cast<ptrdiff_t>(current_line_size) ||
+      last_char - current_line > static_cast<ptrdiff_t>(current_line_size))
+    return 0;
+
+  if (log)
+    log->Printf("SBCommandInterpreter(%p)::HandleCompletion "
+                "(current_line=\"%s\", cursor at: %" PRId64
+                ", last char at: %" PRId64
+                ", match_start_point: %d, max_return_elements: %d)",
+                static_cast<void *>(m_opaque_ptr), current_line,
+                static_cast<uint64_t>(cursor - current_line),
+                static_cast<uint64_t>(last_char - current_line),
+                match_start_point, max_return_elements);
+
+  if (IsValid()) {
+    lldb_private::StringList lldb_matches;
+    num_completions = m_opaque_ptr->HandleCompletion(
+        current_line, cursor, last_char, match_start_point, max_return_elements,
+        lldb_matches);
+
+    SBStringList temp_list(&lldb_matches);
+    matches.AppendList(temp_list);
+  }
+  if (log)
+    log->Printf(
+        "SBCommandInterpreter(%p)::HandleCompletion - Found %d completions.",
+        static_cast<void *>(m_opaque_ptr), num_completions);
+
+  return num_completions;
+}
+
+int SBCommandInterpreter::HandleCompletion(const char *current_line,
+                                           uint32_t cursor_pos,
+                                           int match_start_point,
+                                           int max_return_elements,
+                                           lldb::SBStringList &matches) {
+  const char *cursor = current_line + cursor_pos;
+  const char *last_char = current_line + strlen(current_line);
+  return HandleCompletion(current_line, cursor, last_char, match_start_point,
+                          max_return_elements, matches);
+}
+
+bool SBCommandInterpreter::HasCommands() {
+  return (IsValid() ? m_opaque_ptr->HasCommands() : false);
+}
+
+bool SBCommandInterpreter::HasAliases() {
+  return (IsValid() ? m_opaque_ptr->HasAliases() : false);
+}
+
+bool SBCommandInterpreter::HasAliasOptions() {
+  return (IsValid() ? m_opaque_ptr->HasAliasOptions() : false);
+}
+
+SBProcess SBCommandInterpreter::GetProcess() {
+  SBProcess sb_process;
+  ProcessSP process_sp;
+  if (IsValid()) {
+    TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
+    if (target_sp) {
+      std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
+      process_sp = target_sp->GetProcessSP();
+      sb_process.SetSP(process_sp);
+    }
+  }
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (log)
+    log->Printf("SBCommandInterpreter(%p)::GetProcess () => SBProcess(%p)",
+                static_cast<void *>(m_opaque_ptr),
+                static_cast<void *>(process_sp.get()));
+
+  return sb_process;
+}
+
+SBDebugger SBCommandInterpreter::GetDebugger() {
+  SBDebugger sb_debugger;
+  if (IsValid())
+    sb_debugger.reset(m_opaque_ptr->GetDebugger().shared_from_this());
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (log)
+    log->Printf("SBCommandInterpreter(%p)::GetDebugger () => SBDebugger(%p)",
+                static_cast<void *>(m_opaque_ptr),
+                static_cast<void *>(sb_debugger.get()));
+
+  return sb_debugger;
+}
+
+bool SBCommandInterpreter::GetPromptOnQuit() {
+  return (IsValid() ? m_opaque_ptr->GetPromptOnQuit() : false);
+}
+
+void SBCommandInterpreter::SetPromptOnQuit(bool b) {
+  if (IsValid())
+    m_opaque_ptr->SetPromptOnQuit(b);
+}
+
+void SBCommandInterpreter::ResolveCommand(const char *command_line,
+                                          SBCommandReturnObject &result) {
+  result.Clear();
+  if (command_line && IsValid()) {
+    m_opaque_ptr->ResolveCommand(command_line, result.ref());
+  } else {
+    result->AppendError(
+        "SBCommandInterpreter or the command line is not valid");
+    result->SetStatus(eReturnStatusFailed);
+  }
+}
+
+CommandInterpreter *SBCommandInterpreter::get() { return m_opaque_ptr; }
+
+CommandInterpreter &SBCommandInterpreter::ref() {
+  assert(m_opaque_ptr);
+  return *m_opaque_ptr;
+}
+
+void SBCommandInterpreter::reset(
+    lldb_private::CommandInterpreter *interpreter) {
+  m_opaque_ptr = interpreter;
+}
+
+void SBCommandInterpreter::SourceInitFileInHomeDirectory(
+    SBCommandReturnObject &result) {
+  result.Clear();
+  if (IsValid()) {
+    TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
+    std::unique_lock<std::recursive_mutex> lock;
+    if (target_sp)
+      lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
+    m_opaque_ptr->SourceInitFile(false, result.ref());
+  } else {
+    result->AppendError("SBCommandInterpreter is not valid");
+    result->SetStatus(eReturnStatusFailed);
+  }
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (log)
+    log->Printf("SBCommandInterpreter(%p)::SourceInitFileInHomeDirectory "
+                "(&SBCommandReturnObject(%p))",
+                static_cast<void *>(m_opaque_ptr),
+                static_cast<void *>(result.get()));
+}
+
+void SBCommandInterpreter::SourceInitFileInCurrentWorkingDirectory(
+    SBCommandReturnObject &result) {
+  result.Clear();
+  if (IsValid()) {
+    TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
+    std::unique_lock<std::recursive_mutex> lock;
+    if (target_sp)
+      lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
+    m_opaque_ptr->SourceInitFile(true, result.ref());
+  } else {
+    result->AppendError("SBCommandInterpreter is not valid");
+    result->SetStatus(eReturnStatusFailed);
+  }
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (log)
+    log->Printf(
+        "SBCommandInterpreter(%p)::SourceInitFileInCurrentWorkingDirectory "
+        "(&SBCommandReturnObject(%p))",
+        static_cast<void *>(m_opaque_ptr), static_cast<void *>(result.get()));
+}
+
+SBBroadcaster SBCommandInterpreter::GetBroadcaster() {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  SBBroadcaster broadcaster(m_opaque_ptr, false);
+
+  if (log)
+    log->Printf(
+        "SBCommandInterpreter(%p)::GetBroadcaster() => SBBroadcaster(%p)",
+        static_cast<void *>(m_opaque_ptr),
+        static_cast<void *>(broadcaster.get()));
+
+  return broadcaster;
+}
+
+const char *SBCommandInterpreter::GetBroadcasterClass() {
+  return CommandInterpreter::GetStaticBroadcasterClass().AsCString();
+}
+
+const char *SBCommandInterpreter::GetArgumentTypeAsCString(
+    const lldb::CommandArgumentType arg_type) {
+  return CommandObject::GetArgumentTypeAsCString(arg_type);
+}
+
+const char *SBCommandInterpreter::GetArgumentDescriptionAsCString(
+    const lldb::CommandArgumentType arg_type) {
+  return CommandObject::GetArgumentDescriptionAsCString(arg_type);
+}
+
+bool SBCommandInterpreter::EventIsCommandInterpreterEvent(
+    const lldb::SBEvent &event) {
+  return event.GetBroadcasterClass() ==
+         SBCommandInterpreter::GetBroadcasterClass();
+}
+
+bool SBCommandInterpreter::SetCommandOverrideCallback(
+    const char *command_name, lldb::CommandOverrideCallback callback,
+    void *baton) {
+  if (command_name && command_name[0] && IsValid()) {
+    std::string command_name_str(command_name);
+    CommandObject *cmd_obj =
+        m_opaque_ptr->GetCommandObjectForCommand(command_name_str);
+    if (cmd_obj) {
+      assert(command_name_str.empty());
+      cmd_obj->SetOverrideCallback(callback, baton);
+      return true;
+    }
+  }
+  return false;
+}
+
+lldb::SBCommand SBCommandInterpreter::AddMultiwordCommand(const char *name,
+                                                          const char *help) {
+  CommandObjectMultiword *new_command =
+      new CommandObjectMultiword(*m_opaque_ptr, name, help);
+  new_command->SetRemovable(true);
+  lldb::CommandObjectSP new_command_sp(new_command);
+  if (new_command_sp &&
+      m_opaque_ptr->AddUserCommand(name, new_command_sp, true))
+    return lldb::SBCommand(new_command_sp);
+  return lldb::SBCommand();
+}
+
+lldb::SBCommand SBCommandInterpreter::AddCommand(
+    const char *name, lldb::SBCommandPluginInterface *impl, const char *help) {
+  lldb::CommandObjectSP new_command_sp;
+  new_command_sp.reset(new CommandPluginInterfaceImplementation(
+      *m_opaque_ptr, name, impl, help));
+
+  if (new_command_sp &&
+      m_opaque_ptr->AddUserCommand(name, new_command_sp, true))
+    return lldb::SBCommand(new_command_sp);
+  return lldb::SBCommand();
 }
 
-void
-SBCommandInterpreter::HandleCommandsFromFile (lldb::SBFileSpec &file,
-                                              lldb::SBExecutionContext &override_context,
-                                              lldb::SBCommandInterpreterRunOptions &options,
-                                              lldb::SBCommandReturnObject result)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-    {
-        SBStream s;
-        file.GetDescription (s);
-        log->Printf ("SBCommandInterpreter(%p)::HandleCommandsFromFile (file=\"%s\", SBCommandReturnObject(%p))",
-                     static_cast<void*>(m_opaque_ptr), s.GetData(),
-                     static_cast<void*>(result.get()));
-    }
-
-    if (!IsValid())
-    {
-        result->AppendError ("SBCommandInterpreter is not valid.");
-        result->SetStatus (eReturnStatusFailed);
-        return;
-    }
-
-    if (!file.IsValid())
-    {
-        SBStream s;
-        file.GetDescription (s);
-        result->AppendErrorWithFormat ("File is not valid: %s.", s.GetData());
-        result->SetStatus (eReturnStatusFailed);
-    }
-
-    FileSpec tmp_spec = file.ref();
-    ExecutionContext ctx, *ctx_ptr;
-    if (override_context.get())
-    {
-        ctx = override_context.get()->Lock(true);
-        ctx_ptr = &ctx;
-    }
-    else
-       ctx_ptr = nullptr;
-
-    m_opaque_ptr->HandleCommandsFromFile (tmp_spec, ctx_ptr, options.ref(), result.ref());
-}
-
-int
-SBCommandInterpreter::HandleCompletion (const char *current_line,
-                                        const char *cursor,
-                                        const char *last_char,
-                                        int match_start_point,
-                                        int max_return_elements,
-                                        SBStringList &matches)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    int num_completions = 0;
-
-    // Sanity check the arguments that are passed in:
-    // cursor & last_char have to be within the current_line.
-    if (current_line == nullptr || cursor == nullptr || last_char == nullptr)
-        return 0;
-
-    if (cursor < current_line || last_char < current_line)
-        return 0;
-
-    size_t current_line_size = strlen (current_line);
-    if (cursor - current_line > static_cast<ptrdiff_t>(current_line_size) ||
-        last_char - current_line > static_cast<ptrdiff_t>(current_line_size))
-        return 0;
-
-    if (log)
-        log->Printf ("SBCommandInterpreter(%p)::HandleCompletion (current_line=\"%s\", cursor at: %" PRId64 ", last char at: %" PRId64 ", match_start_point: %d, max_return_elements: %d)",
-                     static_cast<void*>(m_opaque_ptr), current_line,
-                     static_cast<uint64_t>(cursor - current_line),
-                     static_cast<uint64_t>(last_char - current_line),
-                     match_start_point, max_return_elements);
-
-    if (IsValid())
-    {
-        lldb_private::StringList lldb_matches;
-        num_completions = m_opaque_ptr->HandleCompletion(current_line, cursor, last_char, match_start_point,
-                                                         max_return_elements, lldb_matches);
-
-        SBStringList temp_list (&lldb_matches);
-        matches.AppendList (temp_list);
-    }
-    if (log)
-        log->Printf ("SBCommandInterpreter(%p)::HandleCompletion - Found %d completions.",
-                     static_cast<void*>(m_opaque_ptr), num_completions);
-
-    return num_completions;
-}
-
-int
-SBCommandInterpreter::HandleCompletion (const char *current_line,
-                  uint32_t cursor_pos,
-                  int match_start_point,
-                  int max_return_elements,
-                  lldb::SBStringList &matches)
-{
-    const char *cursor = current_line + cursor_pos;
-    const char *last_char = current_line + strlen (current_line);
-    return HandleCompletion (current_line, cursor, last_char, match_start_point, max_return_elements, matches);
-}
-
-bool
-SBCommandInterpreter::HasCommands()
-{
-    return (IsValid() ? m_opaque_ptr->HasCommands() : false);
-}
-
-bool
-SBCommandInterpreter::HasAliases()
-{
-    return (IsValid() ? m_opaque_ptr->HasAliases() : false);
-}
-
-bool
-SBCommandInterpreter::HasAliasOptions()
-{
-    return (IsValid() ? m_opaque_ptr->HasAliasOptions() : false);
-}
-
-SBProcess
-SBCommandInterpreter::GetProcess ()
-{
-    SBProcess sb_process;
-    ProcessSP process_sp;
-    if (IsValid())
-    {
-        TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
-        if (target_sp)
-        {
-            std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
-            process_sp = target_sp->GetProcessSP();
-            sb_process.SetSP(process_sp);
-        }
-    }
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBCommandInterpreter(%p)::GetProcess () => SBProcess(%p)", 
-                     static_cast<void*>(m_opaque_ptr),
-                     static_cast<void*>(process_sp.get()));
-
-    return sb_process;
-}
-
-SBDebugger
-SBCommandInterpreter::GetDebugger ()
-{
-    SBDebugger sb_debugger;
-    if (IsValid())
-        sb_debugger.reset(m_opaque_ptr->GetDebugger().shared_from_this());
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBCommandInterpreter(%p)::GetDebugger () => SBDebugger(%p)",
-                     static_cast<void*>(m_opaque_ptr),
-                     static_cast<void*>(sb_debugger.get()));
-
-    return sb_debugger;
-}
-
-bool
-SBCommandInterpreter::GetPromptOnQuit()
-{
-    return (IsValid() ? m_opaque_ptr->GetPromptOnQuit() : false);
-}
-
-void
-SBCommandInterpreter::SetPromptOnQuit (bool b)
-{
-    if (IsValid())
-        m_opaque_ptr->SetPromptOnQuit(b);
-}
-
-void
-SBCommandInterpreter::ResolveCommand(const char *command_line, SBCommandReturnObject &result)
-{
-    result.Clear();
-    if (command_line && IsValid())
-    {
-        m_opaque_ptr->ResolveCommand(command_line, result.ref());
-    }
-    else
-    {
-        result->AppendError("SBCommandInterpreter or the command line is not valid");
-        result->SetStatus(eReturnStatusFailed);
-    }
-}
-
-CommandInterpreter *
-SBCommandInterpreter::get ()
-{
-    return m_opaque_ptr;
-}
-
-CommandInterpreter &
-SBCommandInterpreter::ref ()
-{
-    assert (m_opaque_ptr);
-    return *m_opaque_ptr;
-}
-
-void
-SBCommandInterpreter::reset (lldb_private::CommandInterpreter *interpreter)
-{
-    m_opaque_ptr = interpreter;
-}
-
-void
-SBCommandInterpreter::SourceInitFileInHomeDirectory (SBCommandReturnObject &result)
-{
-    result.Clear();
-    if (IsValid())
-    {
-        TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
-        std::unique_lock<std::recursive_mutex> lock;
-        if (target_sp)
-            lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
-        m_opaque_ptr->SourceInitFile (false, result.ref());
-    }
-    else
-    {
-        result->AppendError ("SBCommandInterpreter is not valid");
-        result->SetStatus (eReturnStatusFailed);
-    }
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBCommandInterpreter(%p)::SourceInitFileInHomeDirectory (&SBCommandReturnObject(%p))", 
-                     static_cast<void*>(m_opaque_ptr),
-                     static_cast<void*>(result.get()));
-}
-
-void
-SBCommandInterpreter::SourceInitFileInCurrentWorkingDirectory (SBCommandReturnObject &result)
-{
-    result.Clear();
-    if (IsValid())
-    {
-        TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
-        std::unique_lock<std::recursive_mutex> lock;
-        if (target_sp)
-            lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
-        m_opaque_ptr->SourceInitFile (true, result.ref());
-    }
-    else
-    {
-        result->AppendError ("SBCommandInterpreter is not valid");
-        result->SetStatus (eReturnStatusFailed);
-    }
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBCommandInterpreter(%p)::SourceInitFileInCurrentWorkingDirectory (&SBCommandReturnObject(%p))", 
-                     static_cast<void*>(m_opaque_ptr),
-                     static_cast<void*>(result.get()));
+lldb::SBCommand
+SBCommandInterpreter::AddCommand(const char *name,
+                                 lldb::SBCommandPluginInterface *impl,
+                                 const char *help, const char *syntax) {
+  lldb::CommandObjectSP new_command_sp;
+  new_command_sp.reset(new CommandPluginInterfaceImplementation(
+      *m_opaque_ptr, name, impl, help, syntax));
+
+  if (new_command_sp &&
+      m_opaque_ptr->AddUserCommand(name, new_command_sp, true))
+    return lldb::SBCommand(new_command_sp);
+  return lldb::SBCommand();
 }
 
-SBBroadcaster
-SBCommandInterpreter::GetBroadcaster ()
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    SBBroadcaster broadcaster (m_opaque_ptr, false);
+SBCommand::SBCommand() = default;
 
-    if (log)
-        log->Printf ("SBCommandInterpreter(%p)::GetBroadcaster() => SBBroadcaster(%p)", 
-                     static_cast<void*>(m_opaque_ptr), static_cast<void*>(broadcaster.get()));
+SBCommand::SBCommand(lldb::CommandObjectSP cmd_sp) : m_opaque_sp(cmd_sp) {}
 
-    return broadcaster;
-}
+bool SBCommand::IsValid() { return m_opaque_sp.get() != nullptr; }
 
-const char *
-SBCommandInterpreter::GetBroadcasterClass ()
-{
-    return CommandInterpreter::GetStaticBroadcasterClass().AsCString();
+const char *SBCommand::GetName() {
+  return (IsValid() ? m_opaque_sp->GetCommandName() : nullptr);
 }
 
-const char * 
-SBCommandInterpreter::GetArgumentTypeAsCString (const lldb::CommandArgumentType arg_type)
-{
-    return CommandObject::GetArgumentTypeAsCString (arg_type);
+const char *SBCommand::GetHelp() {
+  return (IsValid() ? m_opaque_sp->GetHelp() : nullptr);
 }
 
-const char * 
-SBCommandInterpreter::GetArgumentDescriptionAsCString (const lldb::CommandArgumentType arg_type)
-{
-    return CommandObject::GetArgumentDescriptionAsCString (arg_type);
+const char *SBCommand::GetHelpLong() {
+  return (IsValid() ? m_opaque_sp->GetHelpLong() : nullptr);
 }
 
-bool
-SBCommandInterpreter::EventIsCommandInterpreterEvent (const lldb::SBEvent &event)
-{
-    return event.GetBroadcasterClass() == SBCommandInterpreter::GetBroadcasterClass();
+void SBCommand::SetHelp(const char *help) {
+  if (IsValid())
+    m_opaque_sp->SetHelp(help);
 }
 
-bool
-SBCommandInterpreter::SetCommandOverrideCallback (const char *command_name,
-                                                  lldb::CommandOverrideCallback callback,
-                                                  void *baton)
-{
-    if (command_name && command_name[0] && IsValid())
-    {
-        std::string command_name_str (command_name);
-        CommandObject *cmd_obj = m_opaque_ptr->GetCommandObjectForCommand(command_name_str);
-        if (cmd_obj)
-        {
-            assert(command_name_str.empty());
-            cmd_obj->SetOverrideCallback (callback, baton);
-            return true;
-        }
-    }
-    return false;
+void SBCommand::SetHelpLong(const char *help) {
+  if (IsValid())
+    m_opaque_sp->SetHelpLong(help);
 }
 
-lldb::SBCommand
-SBCommandInterpreter::AddMultiwordCommand (const char* name, const char* help)
-{
-    CommandObjectMultiword *new_command = new CommandObjectMultiword(*m_opaque_ptr, name, help);
-    new_command->SetRemovable (true);
-    lldb::CommandObjectSP new_command_sp(new_command);
-    if (new_command_sp && m_opaque_ptr->AddUserCommand(name, new_command_sp, true))
-        return lldb::SBCommand(new_command_sp);
+lldb::SBCommand SBCommand::AddMultiwordCommand(const char *name,
+                                               const char *help) {
+  if (!IsValid())
     return lldb::SBCommand();
-}
-
-lldb::SBCommand
-SBCommandInterpreter::AddCommand (const char* name, lldb::SBCommandPluginInterface* impl, const char* help)
-{
-    lldb::CommandObjectSP new_command_sp;
-    new_command_sp.reset(new CommandPluginInterfaceImplementation(*m_opaque_ptr,name, impl, help));
-
-    if (new_command_sp && m_opaque_ptr->AddUserCommand(name, new_command_sp, true))
-        return lldb::SBCommand(new_command_sp);
+  if (!m_opaque_sp->IsMultiwordObject())
     return lldb::SBCommand();
+  CommandObjectMultiword *new_command = new CommandObjectMultiword(
+      m_opaque_sp->GetCommandInterpreter(), name, help);
+  new_command->SetRemovable(true);
+  lldb::CommandObjectSP new_command_sp(new_command);
+  if (new_command_sp && m_opaque_sp->LoadSubCommand(name, new_command_sp))
+    return lldb::SBCommand(new_command_sp);
+  return lldb::SBCommand();
 }
 
-lldb::SBCommand
-SBCommandInterpreter::AddCommand (const char* name, lldb::SBCommandPluginInterface* impl, const char* help, const char* syntax)
-{
-    lldb::CommandObjectSP new_command_sp;
-    new_command_sp.reset(new CommandPluginInterfaceImplementation(*m_opaque_ptr,name, impl, help, syntax));
-
-    if (new_command_sp && m_opaque_ptr->AddUserCommand(name, new_command_sp, true))
-        return lldb::SBCommand(new_command_sp);
+lldb::SBCommand SBCommand::AddCommand(const char *name,
+                                      lldb::SBCommandPluginInterface *impl,
+                                      const char *help) {
+  if (!IsValid())
     return lldb::SBCommand();
-}
-
-SBCommand::SBCommand() = default;
-
-SBCommand::SBCommand (lldb::CommandObjectSP cmd_sp) : m_opaque_sp (cmd_sp)
-{}
-
-bool
-SBCommand::IsValid()
-{
-    return m_opaque_sp.get() != nullptr;
-}
-
-const char*
-SBCommand::GetName()
-{
-    return (IsValid() ? m_opaque_sp->GetCommandName() : nullptr);
-}
-
-const char*
-SBCommand::GetHelp()
-{
-    return (IsValid() ? m_opaque_sp->GetHelp() : nullptr);
-}
-
-const char*
-SBCommand::GetHelpLong()
-{
-    return (IsValid() ? m_opaque_sp->GetHelpLong() : nullptr);
-}
-
-void
-SBCommand::SetHelp (const char* help)
-{
-    if (IsValid())
-        m_opaque_sp->SetHelp(help);
-}
-
-void
-SBCommand::SetHelpLong (const char* help)
-{
-    if (IsValid())
-        m_opaque_sp->SetHelpLong(help);
-}
-
-lldb::SBCommand
-SBCommand::AddMultiwordCommand (const char* name, const char* help)
-{
-    if (!IsValid ())
-        return lldb::SBCommand();
-    if (!m_opaque_sp->IsMultiwordObject())
-        return lldb::SBCommand();
-    CommandObjectMultiword *new_command = new CommandObjectMultiword(m_opaque_sp->GetCommandInterpreter(),name,help);
-    new_command->SetRemovable (true);
-    lldb::CommandObjectSP new_command_sp(new_command);
-    if (new_command_sp && m_opaque_sp->LoadSubCommand(name,new_command_sp))
-        return lldb::SBCommand(new_command_sp);
+  if (!m_opaque_sp->IsMultiwordObject())
     return lldb::SBCommand();
+  lldb::CommandObjectSP new_command_sp;
+  new_command_sp.reset(new CommandPluginInterfaceImplementation(
+      m_opaque_sp->GetCommandInterpreter(), name, impl, help));
+  if (new_command_sp && m_opaque_sp->LoadSubCommand(name, new_command_sp))
+    return lldb::SBCommand(new_command_sp);
+  return lldb::SBCommand();
 }
 
-lldb::SBCommand
-SBCommand::AddCommand (const char* name, lldb::SBCommandPluginInterface *impl, const char* help)
-{
-    if (!IsValid ())
-        return lldb::SBCommand();
-    if (!m_opaque_sp->IsMultiwordObject())
-        return lldb::SBCommand();
-    lldb::CommandObjectSP new_command_sp;
-    new_command_sp.reset(new CommandPluginInterfaceImplementation(m_opaque_sp->GetCommandInterpreter(),name,impl,help));
-    if (new_command_sp && m_opaque_sp->LoadSubCommand(name,new_command_sp))
-        return lldb::SBCommand(new_command_sp);
+lldb::SBCommand SBCommand::AddCommand(const char *name,
+                                      lldb::SBCommandPluginInterface *impl,
+                                      const char *help, const char *syntax) {
+  if (!IsValid())
     return lldb::SBCommand();
-}
-
-lldb::SBCommand
-SBCommand::AddCommand (const char* name, lldb::SBCommandPluginInterface *impl, const char* help, const char* syntax)
-{
-    if (!IsValid ())
-        return lldb::SBCommand();
-    if (!m_opaque_sp->IsMultiwordObject())
-        return lldb::SBCommand();
-    lldb::CommandObjectSP new_command_sp;
-    new_command_sp.reset(new CommandPluginInterfaceImplementation(m_opaque_sp->GetCommandInterpreter(),name,impl,help, syntax));
-    if (new_command_sp && m_opaque_sp->LoadSubCommand(name,new_command_sp))
-        return lldb::SBCommand(new_command_sp);
+  if (!m_opaque_sp->IsMultiwordObject())
     return lldb::SBCommand();
+  lldb::CommandObjectSP new_command_sp;
+  new_command_sp.reset(new CommandPluginInterfaceImplementation(
+      m_opaque_sp->GetCommandInterpreter(), name, impl, help, syntax));
+  if (new_command_sp && m_opaque_sp->LoadSubCommand(name, new_command_sp))
+    return lldb::SBCommand(new_command_sp);
+  return lldb::SBCommand();
 }
 
-
-uint32_t
-SBCommand::GetFlags ()
-{
-    return (IsValid() ? m_opaque_sp->GetFlags().Get() : 0);
+uint32_t SBCommand::GetFlags() {
+  return (IsValid() ? m_opaque_sp->GetFlags().Get() : 0);
 }
 
-void
-SBCommand::SetFlags (uint32_t flags)
-{
-    if (IsValid())
-        m_opaque_sp->GetFlags().Set(flags);
+void SBCommand::SetFlags(uint32_t flags) {
+  if (IsValid())
+    m_opaque_sp->GetFlags().Set(flags);
 }

Modified: lldb/trunk/source/API/SBCommandReturnObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCommandReturnObject.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBCommandReturnObject.cpp (original)
+++ lldb/trunk/source/API/SBCommandReturnObject.cpp Tue Sep  6 15:57:50 2016
@@ -22,333 +22,256 @@
 using namespace lldb;
 using namespace lldb_private;
 
-SBCommandReturnObject::SBCommandReturnObject () :
-    m_opaque_ap (new CommandReturnObject ())
-{
+SBCommandReturnObject::SBCommandReturnObject()
+    : m_opaque_ap(new CommandReturnObject()) {}
+
+SBCommandReturnObject::SBCommandReturnObject(const SBCommandReturnObject &rhs)
+    : m_opaque_ap() {
+  if (rhs.m_opaque_ap)
+    m_opaque_ap.reset(new CommandReturnObject(*rhs.m_opaque_ap));
 }
 
-SBCommandReturnObject::SBCommandReturnObject (const SBCommandReturnObject &rhs):
-    m_opaque_ap ()
-{
+SBCommandReturnObject::SBCommandReturnObject(CommandReturnObject *ptr)
+    : m_opaque_ap(ptr) {}
+
+SBCommandReturnObject::~SBCommandReturnObject() = default;
+
+CommandReturnObject *SBCommandReturnObject::Release() {
+  return m_opaque_ap.release();
+}
+
+const SBCommandReturnObject &SBCommandReturnObject::
+operator=(const SBCommandReturnObject &rhs) {
+  if (this != &rhs) {
     if (rhs.m_opaque_ap)
-        m_opaque_ap.reset (new CommandReturnObject (*rhs.m_opaque_ap));
+      m_opaque_ap.reset(new CommandReturnObject(*rhs.m_opaque_ap));
+    else
+      m_opaque_ap.reset();
+  }
+  return *this;
 }
 
-SBCommandReturnObject::SBCommandReturnObject (CommandReturnObject *ptr) :
-    m_opaque_ap (ptr)
-{
+bool SBCommandReturnObject::IsValid() const {
+  return m_opaque_ap.get() != nullptr;
 }
 
-SBCommandReturnObject::~SBCommandReturnObject() = default;
+const char *SBCommandReturnObject::GetOutput() {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-CommandReturnObject *
-SBCommandReturnObject::Release ()
-{
-    return m_opaque_ap.release();
-}
-
-const SBCommandReturnObject &
-SBCommandReturnObject::operator = (const SBCommandReturnObject &rhs)
-{
-    if (this != &rhs)
-    {
-        if (rhs.m_opaque_ap)
-            m_opaque_ap.reset (new CommandReturnObject (*rhs.m_opaque_ap));
-        else
-            m_opaque_ap.reset();
-    }
-    return *this;
-}
-
-bool
-SBCommandReturnObject::IsValid() const
-{
-    return m_opaque_ap.get() != nullptr;
-}
-
-const char *
-SBCommandReturnObject::GetOutput ()
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (m_opaque_ap)
-    {
-        if (log)
-            log->Printf ("SBCommandReturnObject(%p)::GetOutput () => \"%s\"",
-                         static_cast<void*>(m_opaque_ap.get()),
-                         m_opaque_ap->GetOutputData());
+  if (m_opaque_ap) {
+    if (log)
+      log->Printf("SBCommandReturnObject(%p)::GetOutput () => \"%s\"",
+                  static_cast<void *>(m_opaque_ap.get()),
+                  m_opaque_ap->GetOutputData());
 
-        return m_opaque_ap->GetOutputData();
-    }
+    return m_opaque_ap->GetOutputData();
+  }
 
-    if (log)
-        log->Printf ("SBCommandReturnObject(%p)::GetOutput () => nullptr",
-                     static_cast<void*>(m_opaque_ap.get()));
+  if (log)
+    log->Printf("SBCommandReturnObject(%p)::GetOutput () => nullptr",
+                static_cast<void *>(m_opaque_ap.get()));
 
-    return nullptr;
+  return nullptr;
 }
 
-const char *
-SBCommandReturnObject::GetError ()
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (m_opaque_ap)
-    {
-        if (log)
-            log->Printf ("SBCommandReturnObject(%p)::GetError () => \"%s\"",
-                         static_cast<void*>(m_opaque_ap.get()),
-                         m_opaque_ap->GetErrorData());
-
-        return m_opaque_ap->GetErrorData();
-    }
+const char *SBCommandReturnObject::GetError() {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
+  if (m_opaque_ap) {
     if (log)
-        log->Printf ("SBCommandReturnObject(%p)::GetError () => nullptr",
-                     static_cast<void*>(m_opaque_ap.get()));
+      log->Printf("SBCommandReturnObject(%p)::GetError () => \"%s\"",
+                  static_cast<void *>(m_opaque_ap.get()),
+                  m_opaque_ap->GetErrorData());
 
-    return nullptr;
+    return m_opaque_ap->GetErrorData();
+  }
+
+  if (log)
+    log->Printf("SBCommandReturnObject(%p)::GetError () => nullptr",
+                static_cast<void *>(m_opaque_ap.get()));
+
+  return nullptr;
 }
 
-size_t
-SBCommandReturnObject::GetOutputSize()
-{
-    return (m_opaque_ap ? strlen(m_opaque_ap->GetOutputData()) : 0);
+size_t SBCommandReturnObject::GetOutputSize() {
+  return (m_opaque_ap ? strlen(m_opaque_ap->GetOutputData()) : 0);
 }
 
-size_t
-SBCommandReturnObject::GetErrorSize()
-{
-    return (m_opaque_ap ? strlen(m_opaque_ap->GetErrorData()) : 0);
+size_t SBCommandReturnObject::GetErrorSize() {
+  return (m_opaque_ap ? strlen(m_opaque_ap->GetErrorData()) : 0);
 }
 
-size_t
-SBCommandReturnObject::PutOutput (FILE *fh)
-{
-    if (fh)
-    {
-        size_t num_bytes = GetOutputSize ();
-        if (num_bytes)
-            return ::fprintf (fh, "%s", GetOutput());
-    }
-    return 0;
+size_t SBCommandReturnObject::PutOutput(FILE *fh) {
+  if (fh) {
+    size_t num_bytes = GetOutputSize();
+    if (num_bytes)
+      return ::fprintf(fh, "%s", GetOutput());
+  }
+  return 0;
 }
 
-size_t
-SBCommandReturnObject::PutError (FILE *fh)
-{
-    if (fh)
-    {
-        size_t num_bytes = GetErrorSize ();
-        if (num_bytes)
-            return ::fprintf (fh, "%s", GetError());
-    }
-    return 0;
+size_t SBCommandReturnObject::PutError(FILE *fh) {
+  if (fh) {
+    size_t num_bytes = GetErrorSize();
+    if (num_bytes)
+      return ::fprintf(fh, "%s", GetError());
+  }
+  return 0;
 }
 
-void
-SBCommandReturnObject::Clear()
-{
-    if (m_opaque_ap)
-        m_opaque_ap->Clear();
+void SBCommandReturnObject::Clear() {
+  if (m_opaque_ap)
+    m_opaque_ap->Clear();
 }
 
-lldb::ReturnStatus
-SBCommandReturnObject::GetStatus()
-{
-    return (m_opaque_ap ? m_opaque_ap->GetStatus() : lldb::eReturnStatusInvalid);
+lldb::ReturnStatus SBCommandReturnObject::GetStatus() {
+  return (m_opaque_ap ? m_opaque_ap->GetStatus() : lldb::eReturnStatusInvalid);
 }
 
-void
-SBCommandReturnObject::SetStatus(lldb::ReturnStatus status)
-{
-    if (m_opaque_ap)
-         m_opaque_ap->SetStatus(status);
+void SBCommandReturnObject::SetStatus(lldb::ReturnStatus status) {
+  if (m_opaque_ap)
+    m_opaque_ap->SetStatus(status);
 }
 
-bool
-SBCommandReturnObject::Succeeded()
-{
-    return (m_opaque_ap ? m_opaque_ap->Succeeded() : false);
+bool SBCommandReturnObject::Succeeded() {
+  return (m_opaque_ap ? m_opaque_ap->Succeeded() : false);
 }
 
-bool
-SBCommandReturnObject::HasResult()
-{
-    return (m_opaque_ap ? m_opaque_ap->HasResult() : false);
+bool SBCommandReturnObject::HasResult() {
+  return (m_opaque_ap ? m_opaque_ap->HasResult() : false);
 }
 
-void
-SBCommandReturnObject::AppendMessage (const char *message)
-{
-    if (m_opaque_ap)
-        m_opaque_ap->AppendMessage (message);
+void SBCommandReturnObject::AppendMessage(const char *message) {
+  if (m_opaque_ap)
+    m_opaque_ap->AppendMessage(message);
 }
 
-void
-SBCommandReturnObject::AppendWarning (const char *message)
-{
-    if (m_opaque_ap)
-        m_opaque_ap->AppendWarning (message);
+void SBCommandReturnObject::AppendWarning(const char *message) {
+  if (m_opaque_ap)
+    m_opaque_ap->AppendWarning(message);
 }
 
-CommandReturnObject *
-SBCommandReturnObject::operator ->() const
-{
-    return m_opaque_ap.get();
+CommandReturnObject *SBCommandReturnObject::operator->() const {
+  return m_opaque_ap.get();
 }
 
-CommandReturnObject *
-SBCommandReturnObject::get() const
-{
-    return m_opaque_ap.get();
+CommandReturnObject *SBCommandReturnObject::get() const {
+  return m_opaque_ap.get();
 }
 
-CommandReturnObject &
-SBCommandReturnObject::operator *() const
-{
-    assert(m_opaque_ap.get());
-    return *(m_opaque_ap.get());
+CommandReturnObject &SBCommandReturnObject::operator*() const {
+  assert(m_opaque_ap.get());
+  return *(m_opaque_ap.get());
 }
 
-CommandReturnObject &
-SBCommandReturnObject::ref() const
-{
-    assert(m_opaque_ap.get());
-    return *(m_opaque_ap.get());
+CommandReturnObject &SBCommandReturnObject::ref() const {
+  assert(m_opaque_ap.get());
+  return *(m_opaque_ap.get());
 }
 
-void
-SBCommandReturnObject::SetLLDBObjectPtr (CommandReturnObject *ptr)
-{
-    if (m_opaque_ap)
-        m_opaque_ap.reset (ptr);
+void SBCommandReturnObject::SetLLDBObjectPtr(CommandReturnObject *ptr) {
+  if (m_opaque_ap)
+    m_opaque_ap.reset(ptr);
 }
 
-bool
-SBCommandReturnObject::GetDescription (SBStream &description)
-{
-    Stream &strm = description.ref();
+bool SBCommandReturnObject::GetDescription(SBStream &description) {
+  Stream &strm = description.ref();
 
-    if (m_opaque_ap)
-    {
-        description.Printf ("Status:  ");
-        lldb::ReturnStatus status = m_opaque_ap->GetStatus();
-        if (status == lldb::eReturnStatusStarted)
-            strm.PutCString ("Started");
-        else if (status == lldb::eReturnStatusInvalid)
-            strm.PutCString ("Invalid");
-        else if (m_opaque_ap->Succeeded())
-            strm.PutCString ("Success");
-        else
-            strm.PutCString ("Fail");
+  if (m_opaque_ap) {
+    description.Printf("Status:  ");
+    lldb::ReturnStatus status = m_opaque_ap->GetStatus();
+    if (status == lldb::eReturnStatusStarted)
+      strm.PutCString("Started");
+    else if (status == lldb::eReturnStatusInvalid)
+      strm.PutCString("Invalid");
+    else if (m_opaque_ap->Succeeded())
+      strm.PutCString("Success");
+    else
+      strm.PutCString("Fail");
 
-        if (GetOutputSize() > 0)
-            strm.Printf ("\nOutput Message:\n%s", GetOutput());
+    if (GetOutputSize() > 0)
+      strm.Printf("\nOutput Message:\n%s", GetOutput());
 
-        if (GetErrorSize() > 0)
-            strm.Printf ("\nError Message:\n%s", GetError());
-    }
-    else
-        strm.PutCString ("No value");
+    if (GetErrorSize() > 0)
+      strm.Printf("\nError Message:\n%s", GetError());
+  } else
+    strm.PutCString("No value");
 
-    return true;
+  return true;
 }
 
-void
-SBCommandReturnObject::SetImmediateOutputFile(FILE *fh)
-{
-    SetImmediateOutputFile(fh, false);
-}
-
-void
-SBCommandReturnObject::SetImmediateErrorFile(FILE *fh)
-{
-    SetImmediateErrorFile(fh, false);
-}
-
-void
-SBCommandReturnObject::SetImmediateOutputFile(FILE *fh, bool transfer_ownership)
-{
-    if (m_opaque_ap)
-        m_opaque_ap->SetImmediateOutputFile(fh, transfer_ownership);
-}
-
-void
-SBCommandReturnObject::SetImmediateErrorFile(FILE *fh, bool transfer_ownership)
-{
-    if (m_opaque_ap)
-        m_opaque_ap->SetImmediateErrorFile(fh, transfer_ownership);
-}
-
-void
-SBCommandReturnObject::PutCString(const char* string, int len)
-{
-    if (m_opaque_ap)
-    {
-        if (len == 0 || string == nullptr || *string == 0)
-        {
-            return;
-        }
-        else if (len > 0)
-        {
-            std::string buffer(string, len);
-            m_opaque_ap->AppendMessage(buffer.c_str());
-        }
-        else
-            m_opaque_ap->AppendMessage(string);
-    }
-}
-
-const char *
-SBCommandReturnObject::GetOutput (bool only_if_no_immediate)
-{
-    if (!m_opaque_ap)
-        return nullptr;
-    if (!only_if_no_immediate || m_opaque_ap->GetImmediateOutputStream().get() == nullptr)
-        return GetOutput();
-    return nullptr;
+void SBCommandReturnObject::SetImmediateOutputFile(FILE *fh) {
+  SetImmediateOutputFile(fh, false);
 }
 
-const char *
-SBCommandReturnObject::GetError (bool only_if_no_immediate)
-{
-    if (!m_opaque_ap)
-        return nullptr;
-    if (!only_if_no_immediate || m_opaque_ap->GetImmediateErrorStream().get() == nullptr)
-        return GetError();
+void SBCommandReturnObject::SetImmediateErrorFile(FILE *fh) {
+  SetImmediateErrorFile(fh, false);
+}
+
+void SBCommandReturnObject::SetImmediateOutputFile(FILE *fh,
+                                                   bool transfer_ownership) {
+  if (m_opaque_ap)
+    m_opaque_ap->SetImmediateOutputFile(fh, transfer_ownership);
+}
+
+void SBCommandReturnObject::SetImmediateErrorFile(FILE *fh,
+                                                  bool transfer_ownership) {
+  if (m_opaque_ap)
+    m_opaque_ap->SetImmediateErrorFile(fh, transfer_ownership);
+}
+
+void SBCommandReturnObject::PutCString(const char *string, int len) {
+  if (m_opaque_ap) {
+    if (len == 0 || string == nullptr || *string == 0) {
+      return;
+    } else if (len > 0) {
+      std::string buffer(string, len);
+      m_opaque_ap->AppendMessage(buffer.c_str());
+    } else
+      m_opaque_ap->AppendMessage(string);
+  }
+}
+
+const char *SBCommandReturnObject::GetOutput(bool only_if_no_immediate) {
+  if (!m_opaque_ap)
     return nullptr;
+  if (!only_if_no_immediate ||
+      m_opaque_ap->GetImmediateOutputStream().get() == nullptr)
+    return GetOutput();
+  return nullptr;
 }
 
-size_t
-SBCommandReturnObject::Printf(const char* format, ...)
-{
-    if (m_opaque_ap)
-    {
-        va_list args;
-        va_start (args, format);
-        size_t result = m_opaque_ap->GetOutputStream().PrintfVarArg(format, args);
-        va_end (args);
-        return result;
-    }
-    return 0;
-}
-
-void
-SBCommandReturnObject::SetError (lldb::SBError &error, const char *fallback_error_cstr)
-{
-    if (m_opaque_ap)
-    {
-        if (error.IsValid())
-            m_opaque_ap->SetError(error.ref(), fallback_error_cstr);
-        else if (fallback_error_cstr)
-            m_opaque_ap->SetError(Error(), fallback_error_cstr);
-    }
-}
-
-void
-SBCommandReturnObject::SetError (const char *error_cstr)
-{
-    if (m_opaque_ap && error_cstr)
-        m_opaque_ap->SetError(error_cstr);
+const char *SBCommandReturnObject::GetError(bool only_if_no_immediate) {
+  if (!m_opaque_ap)
+    return nullptr;
+  if (!only_if_no_immediate ||
+      m_opaque_ap->GetImmediateErrorStream().get() == nullptr)
+    return GetError();
+  return nullptr;
+}
+
+size_t SBCommandReturnObject::Printf(const char *format, ...) {
+  if (m_opaque_ap) {
+    va_list args;
+    va_start(args, format);
+    size_t result = m_opaque_ap->GetOutputStream().PrintfVarArg(format, args);
+    va_end(args);
+    return result;
+  }
+  return 0;
+}
+
+void SBCommandReturnObject::SetError(lldb::SBError &error,
+                                     const char *fallback_error_cstr) {
+  if (m_opaque_ap) {
+    if (error.IsValid())
+      m_opaque_ap->SetError(error.ref(), fallback_error_cstr);
+    else if (fallback_error_cstr)
+      m_opaque_ap->SetError(Error(), fallback_error_cstr);
+  }
+}
+
+void SBCommandReturnObject::SetError(const char *error_cstr) {
+  if (m_opaque_ap && error_cstr)
+    m_opaque_ap->SetError(error_cstr);
 }

Modified: lldb/trunk/source/API/SBCommunication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCommunication.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBCommunication.cpp (original)
+++ lldb/trunk/source/API/SBCommunication.cpp Tue Sep  6 15:57:50 2016
@@ -16,270 +16,226 @@
 using namespace lldb;
 using namespace lldb_private;
 
+SBCommunication::SBCommunication() : m_opaque(NULL), m_opaque_owned(false) {}
 
+SBCommunication::SBCommunication(const char *broadcaster_name)
+    : m_opaque(new Communication(broadcaster_name)), m_opaque_owned(true) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-SBCommunication::SBCommunication() :
-    m_opaque (NULL),
-    m_opaque_owned (false)
-{
-}
-
-SBCommunication::SBCommunication(const char * broadcaster_name) :
-    m_opaque (new Communication (broadcaster_name)),
-    m_opaque_owned (true)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBCommunication::SBCommunication (broadcaster_name=\"%s\") => "
-                     "SBCommunication(%p)", broadcaster_name,
-                     static_cast<void*>(m_opaque));
-}
-
-SBCommunication::~SBCommunication()
-{
-    if (m_opaque && m_opaque_owned)
-        delete m_opaque;
-    m_opaque = NULL;
-    m_opaque_owned = false;
-}
-
-bool
-SBCommunication::IsValid () const
-{
-    return m_opaque != NULL;
-}
-
-bool
-SBCommunication::GetCloseOnEOF ()
-{
-    if (m_opaque)
-        return m_opaque->GetCloseOnEOF ();
-    return false;
-}
-
-void
-SBCommunication::SetCloseOnEOF (bool b)
-{
-    if (m_opaque)
-        m_opaque->SetCloseOnEOF (b);
-}
-
-ConnectionStatus
-SBCommunication::Connect (const char *url)
-{
-    if (m_opaque)
-    {
-        if (!m_opaque->HasConnection ())
-            m_opaque->SetConnection(Connection::CreateDefaultConnection(url));
-        return m_opaque->Connect (url, NULL);
-    }
-    return eConnectionStatusNoConnection;
+  if (log)
+    log->Printf("SBCommunication::SBCommunication (broadcaster_name=\"%s\") => "
+                "SBCommunication(%p)",
+                broadcaster_name, static_cast<void *>(m_opaque));
 }
 
-ConnectionStatus
-SBCommunication::AdoptFileDesriptor (int fd, bool owns_fd)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    ConnectionStatus status = eConnectionStatusNoConnection;
-    if (m_opaque)
-    {
-        if (m_opaque->HasConnection ())
-        {
-            if (m_opaque->IsConnected())
-                m_opaque->Disconnect();
-        }
-        m_opaque->SetConnection (new ConnectionFileDescriptor (fd, owns_fd));
-        if (m_opaque->IsConnected())
-            status = eConnectionStatusSuccess;
-        else
-            status = eConnectionStatusLostConnection;
-    }
+SBCommunication::~SBCommunication() {
+  if (m_opaque && m_opaque_owned)
+    delete m_opaque;
+  m_opaque = NULL;
+  m_opaque_owned = false;
+}
+
+bool SBCommunication::IsValid() const { return m_opaque != NULL; }
+
+bool SBCommunication::GetCloseOnEOF() {
+  if (m_opaque)
+    return m_opaque->GetCloseOnEOF();
+  return false;
+}
+
+void SBCommunication::SetCloseOnEOF(bool b) {
+  if (m_opaque)
+    m_opaque->SetCloseOnEOF(b);
+}
 
-    if (log)
-        log->Printf ("SBCommunication(%p)::AdoptFileDescriptor (fd=%d, ownd_fd=%i) => %s",
-                     static_cast<void*>(m_opaque), fd, owns_fd,
-                     Communication::ConnectionStatusAsCString (status));
-
-    return status;
+ConnectionStatus SBCommunication::Connect(const char *url) {
+  if (m_opaque) {
+    if (!m_opaque->HasConnection())
+      m_opaque->SetConnection(Connection::CreateDefaultConnection(url));
+    return m_opaque->Connect(url, NULL);
+  }
+  return eConnectionStatusNoConnection;
 }
 
+ConnectionStatus SBCommunication::AdoptFileDesriptor(int fd, bool owns_fd) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-ConnectionStatus
-SBCommunication::Disconnect ()
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    ConnectionStatus status= eConnectionStatusNoConnection;
-    if (m_opaque)
-        status = m_opaque->Disconnect ();
-
-    if (log)
-        log->Printf ("SBCommunication(%p)::Disconnect () => %s",
-                     static_cast<void*>(m_opaque),
-                     Communication::ConnectionStatusAsCString (status));
-
-    return status;
-}
-
-bool
-SBCommunication::IsConnected () const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    bool result = false;
-    if (m_opaque)
-        result = m_opaque->IsConnected ();
-
-    if (log)
-        log->Printf ("SBCommunication(%p)::IsConnected () => %i",
-                     static_cast<void*>(m_opaque), result);
-
-    return false;
-}
-
-size_t
-SBCommunication::Read (void *dst, size_t dst_len, uint32_t timeout_usec, ConnectionStatus &status)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBCommunication(%p)::Read (dst=%p, dst_len=%" PRIu64 ", timeout_usec=%u, &status)...",
-                     static_cast<void*>(m_opaque), static_cast<void*>(dst),
-                     static_cast<uint64_t>(dst_len), timeout_usec);
-    size_t bytes_read = 0;
-    if (m_opaque)
-        bytes_read = m_opaque->Read (dst, dst_len, timeout_usec, status, NULL);
+  ConnectionStatus status = eConnectionStatusNoConnection;
+  if (m_opaque) {
+    if (m_opaque->HasConnection()) {
+      if (m_opaque->IsConnected())
+        m_opaque->Disconnect();
+    }
+    m_opaque->SetConnection(new ConnectionFileDescriptor(fd, owns_fd));
+    if (m_opaque->IsConnected())
+      status = eConnectionStatusSuccess;
     else
-        status = eConnectionStatusNoConnection;
+      status = eConnectionStatusLostConnection;
+  }
+
+  if (log)
+    log->Printf(
+        "SBCommunication(%p)::AdoptFileDescriptor (fd=%d, ownd_fd=%i) => %s",
+        static_cast<void *>(m_opaque), fd, owns_fd,
+        Communication::ConnectionStatusAsCString(status));
 
-    if (log)
-        log->Printf ("SBCommunication(%p)::Read (dst=%p, dst_len=%" PRIu64 ", timeout_usec=%u, &status=%s) => %" PRIu64,
-                     static_cast<void*>(m_opaque), static_cast<void*>(dst),
-                     static_cast<uint64_t>(dst_len), timeout_usec,
-                     Communication::ConnectionStatusAsCString (status),
-                     static_cast<uint64_t>(bytes_read));
-    return bytes_read;
+  return status;
 }
 
+ConnectionStatus SBCommunication::Disconnect() {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-size_t
-SBCommunication::Write (const void *src, size_t src_len, ConnectionStatus &status)
-{
-    size_t bytes_written = 0;
-    if (m_opaque)
-        bytes_written = m_opaque->Write (src, src_len, status, NULL);
-    else
-        status = eConnectionStatusNoConnection;
+  ConnectionStatus status = eConnectionStatusNoConnection;
+  if (m_opaque)
+    status = m_opaque->Disconnect();
 
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBCommunication(%p)::Write (src=%p, src_len=%" PRIu64 ", &status=%s) => %" PRIu64,
-                     static_cast<void*>(m_opaque), static_cast<const void*>(src),
-                     static_cast<uint64_t>(src_len),
-                     Communication::ConnectionStatusAsCString (status),
-                     static_cast<uint64_t>(bytes_written));
-
-    return 0;
-}
-
-bool
-SBCommunication::ReadThreadStart ()
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    bool success = false;
-    if (m_opaque)
-        success = m_opaque->StartReadThread ();
-
-    if (log)
-        log->Printf ("SBCommunication(%p)::ReadThreadStart () => %i",
-                     static_cast<void*>(m_opaque), success);
-
-    return success;
-}
-
-
-bool
-SBCommunication::ReadThreadStop ()
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBCommunication(%p)::ReadThreadStop ()...",
-                     static_cast<void*>(m_opaque));
-
-    bool success = false;
-    if (m_opaque)
-        success = m_opaque->StopReadThread ();
-
-    if (log)
-        log->Printf ("SBCommunication(%p)::ReadThreadStop () => %i",
-                     static_cast<void*>(m_opaque), success);
-
-    return success;
-}
-
-bool
-SBCommunication::ReadThreadIsRunning ()
-{
-    bool result = false;
-    if (m_opaque)
-        result = m_opaque->ReadThreadIsRunning ();
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBCommunication(%p)::ReadThreadIsRunning () => %i",
-                     static_cast<void*>(m_opaque), result);
-    return result;
-}
-
-bool
-SBCommunication::SetReadThreadBytesReceivedCallback
-(
-    ReadThreadBytesReceived callback,
-    void *callback_baton
-)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    bool result = false;
-    if (m_opaque)
-    {
-        m_opaque->SetReadThreadBytesReceivedCallback (callback, callback_baton);
-        result = true;
-    }
+  if (log)
+    log->Printf("SBCommunication(%p)::Disconnect () => %s",
+                static_cast<void *>(m_opaque),
+                Communication::ConnectionStatusAsCString(status));
+
+  return status;
+}
+
+bool SBCommunication::IsConnected() const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  bool result = false;
+  if (m_opaque)
+    result = m_opaque->IsConnected();
+
+  if (log)
+    log->Printf("SBCommunication(%p)::IsConnected () => %i",
+                static_cast<void *>(m_opaque), result);
+
+  return false;
+}
+
+size_t SBCommunication::Read(void *dst, size_t dst_len, uint32_t timeout_usec,
+                             ConnectionStatus &status) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBCommunication(%p)::Read (dst=%p, dst_len=%" PRIu64
+                ", timeout_usec=%u, &status)...",
+                static_cast<void *>(m_opaque), static_cast<void *>(dst),
+                static_cast<uint64_t>(dst_len), timeout_usec);
+  size_t bytes_read = 0;
+  if (m_opaque)
+    bytes_read = m_opaque->Read(dst, dst_len, timeout_usec, status, NULL);
+  else
+    status = eConnectionStatusNoConnection;
+
+  if (log)
+    log->Printf("SBCommunication(%p)::Read (dst=%p, dst_len=%" PRIu64
+                ", timeout_usec=%u, &status=%s) => %" PRIu64,
+                static_cast<void *>(m_opaque), static_cast<void *>(dst),
+                static_cast<uint64_t>(dst_len), timeout_usec,
+                Communication::ConnectionStatusAsCString(status),
+                static_cast<uint64_t>(bytes_read));
+  return bytes_read;
+}
+
+size_t SBCommunication::Write(const void *src, size_t src_len,
+                              ConnectionStatus &status) {
+  size_t bytes_written = 0;
+  if (m_opaque)
+    bytes_written = m_opaque->Write(src, src_len, status, NULL);
+  else
+    status = eConnectionStatusNoConnection;
+
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBCommunication(%p)::Write (src=%p, src_len=%" PRIu64
+                ", &status=%s) => %" PRIu64,
+                static_cast<void *>(m_opaque), static_cast<const void *>(src),
+                static_cast<uint64_t>(src_len),
+                Communication::ConnectionStatusAsCString(status),
+                static_cast<uint64_t>(bytes_written));
+
+  return 0;
+}
+
+bool SBCommunication::ReadThreadStart() {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  bool success = false;
+  if (m_opaque)
+    success = m_opaque->StartReadThread();
+
+  if (log)
+    log->Printf("SBCommunication(%p)::ReadThreadStart () => %i",
+                static_cast<void *>(m_opaque), success);
+
+  return success;
+}
+
+bool SBCommunication::ReadThreadStop() {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBCommunication(%p)::ReadThreadStop ()...",
+                static_cast<void *>(m_opaque));
+
+  bool success = false;
+  if (m_opaque)
+    success = m_opaque->StopReadThread();
+
+  if (log)
+    log->Printf("SBCommunication(%p)::ReadThreadStop () => %i",
+                static_cast<void *>(m_opaque), success);
+
+  return success;
+}
+
+bool SBCommunication::ReadThreadIsRunning() {
+  bool result = false;
+  if (m_opaque)
+    result = m_opaque->ReadThreadIsRunning();
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBCommunication(%p)::ReadThreadIsRunning () => %i",
+                static_cast<void *>(m_opaque), result);
+  return result;
+}
+
+bool SBCommunication::SetReadThreadBytesReceivedCallback(
+    ReadThreadBytesReceived callback, void *callback_baton) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  bool result = false;
+  if (m_opaque) {
+    m_opaque->SetReadThreadBytesReceivedCallback(callback, callback_baton);
+    result = true;
+  }
 
-    if (log)
-        log->Printf ("SBCommunication(%p)::SetReadThreadBytesReceivedCallback (callback=%p, baton=%p) => %i",
-                     static_cast<void*>(m_opaque),
-                     reinterpret_cast<void*>(reinterpret_cast<intptr_t>(callback)),
-                     static_cast<void*>(callback_baton), result);
+  if (log)
+    log->Printf("SBCommunication(%p)::SetReadThreadBytesReceivedCallback "
+                "(callback=%p, baton=%p) => %i",
+                static_cast<void *>(m_opaque),
+                reinterpret_cast<void *>(reinterpret_cast<intptr_t>(callback)),
+                static_cast<void *>(callback_baton), result);
 
-    return result;
+  return result;
 }
 
-SBBroadcaster
-SBCommunication::GetBroadcaster ()
-{
-    SBBroadcaster broadcaster (m_opaque, false);
+SBBroadcaster SBCommunication::GetBroadcaster() {
+  SBBroadcaster broadcaster(m_opaque, false);
 
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-    if (log)
-        log->Printf ("SBCommunication(%p)::GetBroadcaster () => SBBroadcaster (%p)",
-                     static_cast<void*>(m_opaque),
-                     static_cast<void*>(broadcaster.get()));
+  if (log)
+    log->Printf("SBCommunication(%p)::GetBroadcaster () => SBBroadcaster (%p)",
+                static_cast<void *>(m_opaque),
+                static_cast<void *>(broadcaster.get()));
 
-    return broadcaster;
+  return broadcaster;
 }
 
-const char *
-SBCommunication::GetBroadcasterClass ()
-{
-    return Communication::GetStaticBroadcasterClass().AsCString();
+const char *SBCommunication::GetBroadcasterClass() {
+  return Communication::GetStaticBroadcasterClass().AsCString();
 }
 
 //
-//void
-//SBCommunication::CreateIfNeeded ()
+// void
+// SBCommunication::CreateIfNeeded ()
 //{
 //    if (m_opaque == NULL)
 //    {

Modified: lldb/trunk/source/API/SBCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCompileUnit.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBCompileUnit.cpp (original)
+++ lldb/trunk/source/API/SBCompileUnit.cpp Tue Sep  6 15:57:50 2016
@@ -21,275 +21,203 @@
 using namespace lldb;
 using namespace lldb_private;
 
+SBCompileUnit::SBCompileUnit() : m_opaque_ptr(NULL) {}
 
-SBCompileUnit::SBCompileUnit () :
-    m_opaque_ptr (NULL)
-{
-}
-
-SBCompileUnit::SBCompileUnit (lldb_private::CompileUnit *lldb_object_ptr) :
-    m_opaque_ptr (lldb_object_ptr)
-{
-}
+SBCompileUnit::SBCompileUnit(lldb_private::CompileUnit *lldb_object_ptr)
+    : m_opaque_ptr(lldb_object_ptr) {}
 
-SBCompileUnit::SBCompileUnit(const SBCompileUnit &rhs) :
-    m_opaque_ptr (rhs.m_opaque_ptr)
-{
-}
+SBCompileUnit::SBCompileUnit(const SBCompileUnit &rhs)
+    : m_opaque_ptr(rhs.m_opaque_ptr) {}
 
-const SBCompileUnit &
-SBCompileUnit::operator = (const SBCompileUnit &rhs)
-{
-    m_opaque_ptr = rhs.m_opaque_ptr;
-    return *this;
+const SBCompileUnit &SBCompileUnit::operator=(const SBCompileUnit &rhs) {
+  m_opaque_ptr = rhs.m_opaque_ptr;
+  return *this;
 }
 
+SBCompileUnit::~SBCompileUnit() { m_opaque_ptr = NULL; }
 
-SBCompileUnit::~SBCompileUnit ()
-{
-    m_opaque_ptr = NULL;
+SBFileSpec SBCompileUnit::GetFileSpec() const {
+  SBFileSpec file_spec;
+  if (m_opaque_ptr)
+    file_spec.SetFileSpec(*m_opaque_ptr);
+  return file_spec;
 }
 
-SBFileSpec
-SBCompileUnit::GetFileSpec () const
-{
-    SBFileSpec file_spec;
-    if (m_opaque_ptr)
-        file_spec.SetFileSpec(*m_opaque_ptr);
-    return file_spec;
+uint32_t SBCompileUnit::GetNumLineEntries() const {
+  if (m_opaque_ptr) {
+    LineTable *line_table = m_opaque_ptr->GetLineTable();
+    if (line_table)
+      return line_table->GetSize();
+  }
+  return 0;
 }
 
-uint32_t
-SBCompileUnit::GetNumLineEntries () const
-{
-    if (m_opaque_ptr)
-    {
-        LineTable *line_table = m_opaque_ptr->GetLineTable ();
-        if (line_table)
-            return line_table->GetSize();
-    }
-    return 0;
-}
+SBLineEntry SBCompileUnit::GetLineEntryAtIndex(uint32_t idx) const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-SBLineEntry
-SBCompileUnit::GetLineEntryAtIndex (uint32_t idx) const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    SBLineEntry sb_line_entry;
-    if (m_opaque_ptr)
-    {
-        LineTable *line_table = m_opaque_ptr->GetLineTable ();
-        if (line_table)
-        {
-            LineEntry line_entry;
-            if (line_table->GetLineEntryAtIndex(idx, line_entry))
-                sb_line_entry.SetLineEntry(line_entry);
-        }
+  SBLineEntry sb_line_entry;
+  if (m_opaque_ptr) {
+    LineTable *line_table = m_opaque_ptr->GetLineTable();
+    if (line_table) {
+      LineEntry line_entry;
+      if (line_table->GetLineEntryAtIndex(idx, line_entry))
+        sb_line_entry.SetLineEntry(line_entry);
     }
+  }
 
-    if (log)
-    {
-        SBStream sstr;
-        sb_line_entry.GetDescription (sstr);
-        log->Printf ("SBCompileUnit(%p)::GetLineEntryAtIndex (idx=%u) => SBLineEntry(%p): '%s'",
-                     static_cast<void*>(m_opaque_ptr), idx,
-                     static_cast<void*>(sb_line_entry.get()), sstr.GetData());
-    }
+  if (log) {
+    SBStream sstr;
+    sb_line_entry.GetDescription(sstr);
+    log->Printf("SBCompileUnit(%p)::GetLineEntryAtIndex (idx=%u) => "
+                "SBLineEntry(%p): '%s'",
+                static_cast<void *>(m_opaque_ptr), idx,
+                static_cast<void *>(sb_line_entry.get()), sstr.GetData());
+  }
 
-    return sb_line_entry;
+  return sb_line_entry;
 }
 
-uint32_t
-SBCompileUnit::FindLineEntryIndex (uint32_t start_idx, uint32_t line, SBFileSpec *inline_file_spec) const
-{
-    const bool exact = true;
-    return FindLineEntryIndex (start_idx, line, inline_file_spec, exact);
-}
-
-uint32_t
-SBCompileUnit::FindLineEntryIndex (uint32_t start_idx, uint32_t line, SBFileSpec *inline_file_spec, bool exact) const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    uint32_t index = UINT32_MAX;
-    if (m_opaque_ptr)
-    {
-        FileSpec file_spec;
-        if (inline_file_spec && inline_file_spec->IsValid())
-            file_spec = inline_file_spec->ref();
-        else
-            file_spec = *m_opaque_ptr;
-
-        index = m_opaque_ptr->FindLineEntry (start_idx,
-                                             line,
-                                             inline_file_spec ? inline_file_spec->get() : NULL,
-                                             exact,
-                                             NULL);
-    }
-
-    if (log)
-    {
-        SBStream sstr;
-        if (index == UINT32_MAX)
-        {
-            log->Printf ("SBCompileUnit(%p)::FindLineEntryIndex (start_idx=%u, line=%u, SBFileSpec(%p)) => NOT FOUND",
-                         static_cast<void*>(m_opaque_ptr), start_idx, line,
-                         inline_file_spec
-                            ? static_cast<const void*>(inline_file_spec->get())
-                            : NULL);
-        }
-        else
-        {
-            log->Printf ("SBCompileUnit(%p)::FindLineEntryIndex (start_idx=%u, line=%u, SBFileSpec(%p)) => %u",
-                         static_cast<void*>(m_opaque_ptr), start_idx, line,
-                         inline_file_spec
-                            ? static_cast<const void*>(inline_file_spec->get())
-                            : NULL,
-                         index);
-        }
-    }
-
-    return index;
+uint32_t SBCompileUnit::FindLineEntryIndex(uint32_t start_idx, uint32_t line,
+                                           SBFileSpec *inline_file_spec) const {
+  const bool exact = true;
+  return FindLineEntryIndex(start_idx, line, inline_file_spec, exact);
 }
 
-uint32_t
-SBCompileUnit::GetNumSupportFiles () const
-{
-    if (m_opaque_ptr)
-    {
-        FileSpecList& support_files = m_opaque_ptr->GetSupportFiles ();
-        return support_files.GetSize();
-    }
-    return 0;
-}
+uint32_t SBCompileUnit::FindLineEntryIndex(uint32_t start_idx, uint32_t line,
+                                           SBFileSpec *inline_file_spec,
+                                           bool exact) const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
+  uint32_t index = UINT32_MAX;
+  if (m_opaque_ptr) {
+    FileSpec file_spec;
+    if (inline_file_spec && inline_file_spec->IsValid())
+      file_spec = inline_file_spec->ref();
+    else
+      file_spec = *m_opaque_ptr;
 
+    index = m_opaque_ptr->FindLineEntry(
+        start_idx, line, inline_file_spec ? inline_file_spec->get() : NULL,
+        exact, NULL);
+  }
 
-lldb::SBTypeList
-SBCompileUnit::GetTypes (uint32_t type_mask)
-{
-    SBTypeList sb_type_list;
-    
-    if (m_opaque_ptr)
-    {
-        ModuleSP module_sp (m_opaque_ptr->GetModule());
-        if (module_sp)
-        {
-            SymbolVendor* vendor = module_sp->GetSymbolVendor();
-            if (vendor)
-            {
-                TypeList type_list;
-                vendor->GetTypes (m_opaque_ptr, type_mask, type_list);
-                sb_type_list.m_opaque_ap->Append(type_list);
-            }
-        }
+  if (log) {
+    SBStream sstr;
+    if (index == UINT32_MAX) {
+      log->Printf("SBCompileUnit(%p)::FindLineEntryIndex (start_idx=%u, "
+                  "line=%u, SBFileSpec(%p)) => NOT FOUND",
+                  static_cast<void *>(m_opaque_ptr), start_idx, line,
+                  inline_file_spec
+                      ? static_cast<const void *>(inline_file_spec->get())
+                      : NULL);
+    } else {
+      log->Printf("SBCompileUnit(%p)::FindLineEntryIndex (start_idx=%u, "
+                  "line=%u, SBFileSpec(%p)) => %u",
+                  static_cast<void *>(m_opaque_ptr), start_idx, line,
+                  inline_file_spec
+                      ? static_cast<const void *>(inline_file_spec->get())
+                      : NULL,
+                  index);
     }
-    return sb_type_list;
+  }
+
+  return index;
 }
 
+uint32_t SBCompileUnit::GetNumSupportFiles() const {
+  if (m_opaque_ptr) {
+    FileSpecList &support_files = m_opaque_ptr->GetSupportFiles();
+    return support_files.GetSize();
+  }
+  return 0;
+}
 
+lldb::SBTypeList SBCompileUnit::GetTypes(uint32_t type_mask) {
+  SBTypeList sb_type_list;
 
+  if (m_opaque_ptr) {
+    ModuleSP module_sp(m_opaque_ptr->GetModule());
+    if (module_sp) {
+      SymbolVendor *vendor = module_sp->GetSymbolVendor();
+      if (vendor) {
+        TypeList type_list;
+        vendor->GetTypes(m_opaque_ptr, type_mask, type_list);
+        sb_type_list.m_opaque_ap->Append(type_list);
+      }
+    }
+  }
+  return sb_type_list;
+}
 
-SBFileSpec
-SBCompileUnit::GetSupportFileAtIndex (uint32_t idx) const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+SBFileSpec SBCompileUnit::GetSupportFileAtIndex(uint32_t idx) const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-    SBFileSpec sb_file_spec;
-    if (m_opaque_ptr)
-    {
-        FileSpecList &support_files = m_opaque_ptr->GetSupportFiles ();
-        FileSpec file_spec = support_files.GetFileSpecAtIndex(idx);
-        sb_file_spec.SetFileSpec(file_spec);
-    }
+  SBFileSpec sb_file_spec;
+  if (m_opaque_ptr) {
+    FileSpecList &support_files = m_opaque_ptr->GetSupportFiles();
+    FileSpec file_spec = support_files.GetFileSpecAtIndex(idx);
+    sb_file_spec.SetFileSpec(file_spec);
+  }
 
-    if (log)
-    {
-        SBStream sstr;
-        sb_file_spec.GetDescription (sstr);
-        log->Printf ("SBCompileUnit(%p)::GetGetFileSpecAtIndex (idx=%u) => SBFileSpec(%p): '%s'",
-                     static_cast<void*>(m_opaque_ptr), idx,
-                     static_cast<const void*>(sb_file_spec.get()),
-                     sstr.GetData());
-    }
+  if (log) {
+    SBStream sstr;
+    sb_file_spec.GetDescription(sstr);
+    log->Printf("SBCompileUnit(%p)::GetGetFileSpecAtIndex (idx=%u) => "
+                "SBFileSpec(%p): '%s'",
+                static_cast<void *>(m_opaque_ptr), idx,
+                static_cast<const void *>(sb_file_spec.get()), sstr.GetData());
+  }
 
-    return sb_file_spec;
+  return sb_file_spec;
 }
 
-uint32_t
-SBCompileUnit::FindSupportFileIndex (uint32_t start_idx, const SBFileSpec &sb_file, bool full)
-{
-    if (m_opaque_ptr)
-    {
-	FileSpecList &support_files = m_opaque_ptr->GetSupportFiles ();
-	return support_files.FindFileIndex(start_idx, sb_file.ref(), full);
-    }
-    return 0;
+uint32_t SBCompileUnit::FindSupportFileIndex(uint32_t start_idx,
+                                             const SBFileSpec &sb_file,
+                                             bool full) {
+  if (m_opaque_ptr) {
+    FileSpecList &support_files = m_opaque_ptr->GetSupportFiles();
+    return support_files.FindFileIndex(start_idx, sb_file.ref(), full);
+  }
+  return 0;
 }
 
-lldb::LanguageType
-SBCompileUnit::GetLanguage ()
-{
-    if (m_opaque_ptr)
-        return m_opaque_ptr->GetLanguage();
-    return lldb::eLanguageTypeUnknown;
+lldb::LanguageType SBCompileUnit::GetLanguage() {
+  if (m_opaque_ptr)
+    return m_opaque_ptr->GetLanguage();
+  return lldb::eLanguageTypeUnknown;
 }
 
-bool
-SBCompileUnit::IsValid () const
-{
-    return m_opaque_ptr != NULL;
-}
+bool SBCompileUnit::IsValid() const { return m_opaque_ptr != NULL; }
 
-bool
-SBCompileUnit::operator == (const SBCompileUnit &rhs) const
-{
-    return m_opaque_ptr == rhs.m_opaque_ptr;
+bool SBCompileUnit::operator==(const SBCompileUnit &rhs) const {
+  return m_opaque_ptr == rhs.m_opaque_ptr;
 }
 
-bool
-SBCompileUnit::operator != (const SBCompileUnit &rhs) const
-{
-    return m_opaque_ptr != rhs.m_opaque_ptr;
+bool SBCompileUnit::operator!=(const SBCompileUnit &rhs) const {
+  return m_opaque_ptr != rhs.m_opaque_ptr;
 }
 
-const lldb_private::CompileUnit *
-SBCompileUnit::operator->() const
-{
-    return m_opaque_ptr;
+const lldb_private::CompileUnit *SBCompileUnit::operator->() const {
+  return m_opaque_ptr;
 }
 
-const lldb_private::CompileUnit &
-SBCompileUnit::operator*() const
-{
-    return *m_opaque_ptr;
+const lldb_private::CompileUnit &SBCompileUnit::operator*() const {
+  return *m_opaque_ptr;
 }
 
-lldb_private::CompileUnit *
-SBCompileUnit::get ()
-{
-    return m_opaque_ptr;
-}
+lldb_private::CompileUnit *SBCompileUnit::get() { return m_opaque_ptr; }
 
-void
-SBCompileUnit::reset (lldb_private::CompileUnit *lldb_object_ptr)
-{
-    m_opaque_ptr = lldb_object_ptr;
+void SBCompileUnit::reset(lldb_private::CompileUnit *lldb_object_ptr) {
+  m_opaque_ptr = lldb_object_ptr;
 }
 
-    
-bool
-SBCompileUnit::GetDescription (SBStream &description)
-{
-    Stream &strm = description.ref();
+bool SBCompileUnit::GetDescription(SBStream &description) {
+  Stream &strm = description.ref();
 
-    if (m_opaque_ptr)
-    {
-        m_opaque_ptr->Dump (&strm, false);
-    }
-    else
-        strm.PutCString ("No value");
-    
-    return true;
+  if (m_opaque_ptr) {
+    m_opaque_ptr->Dump(&strm, false);
+  } else
+    strm.PutCString("No value");
+
+  return true;
 }

Modified: lldb/trunk/source/API/SBData.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBData.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBData.cpp (original)
+++ lldb/trunk/source/API/SBData.cpp Tue Sep  6 15:57:50 2016
@@ -18,788 +18,682 @@
 #include "lldb/Core/Log.h"
 #include "lldb/Core/Stream.h"
 
-
 using namespace lldb;
 using namespace lldb_private;
 
-SBData::SBData () :
-    m_opaque_sp(new DataExtractor())
-{
-}
-
-SBData::SBData (const lldb::DataExtractorSP& data_sp) :
-    m_opaque_sp (data_sp)
-{
-}
-
-SBData::SBData(const SBData &rhs) :
-    m_opaque_sp (rhs.m_opaque_sp)
-{
-}
-
-const SBData &
-SBData::operator = (const SBData &rhs)
-{
-    if (this != &rhs)
-        m_opaque_sp = rhs.m_opaque_sp;
-    return *this;
-}
-
-SBData::~SBData ()
-{
-}
+SBData::SBData() : m_opaque_sp(new DataExtractor()) {}
 
-void
-SBData::SetOpaque (const lldb::DataExtractorSP &data_sp)
-{
-    m_opaque_sp = data_sp;
-}
+SBData::SBData(const lldb::DataExtractorSP &data_sp) : m_opaque_sp(data_sp) {}
 
-lldb_private::DataExtractor *
-SBData::get() const
-{
-    return m_opaque_sp.get();
-}
-
-lldb_private::DataExtractor *
-SBData::operator->() const
-{
-    return m_opaque_sp.operator->();
-}
-
-lldb::DataExtractorSP &
-SBData::operator*()
-{
-    return m_opaque_sp;
-}
-
-const lldb::DataExtractorSP &
-SBData::operator*() const
-{
-    return m_opaque_sp;
-}
-
-bool
-SBData::IsValid()
-{
-    return m_opaque_sp.get() != NULL;
-}
-
-uint8_t
-SBData::GetAddressByteSize ()
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    uint8_t value = 0;
-    if (m_opaque_sp.get())
-        value = m_opaque_sp->GetAddressByteSize();
-    if (log)
-        log->Printf ("SBData::GetAddressByteSize () => "
-                     "(%i)", value);
-    return value;
-}
-
-void
-SBData::SetAddressByteSize (uint8_t addr_byte_size)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (m_opaque_sp.get())
-        m_opaque_sp->SetAddressByteSize(addr_byte_size);
-    if (log)
-        log->Printf ("SBData::SetAddressByteSize (%i)", addr_byte_size);
-}
-
-void
-SBData::Clear ()
-{
-    if (m_opaque_sp.get())
-        m_opaque_sp->Clear();
-}
-
-size_t
-SBData::GetByteSize ()
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    size_t value = 0;
-    if (m_opaque_sp.get())
-        value = m_opaque_sp->GetByteSize();
-    if (log)
-        log->Printf ("SBData::GetByteSize () => "
-                     "( %" PRIu64 " )", (uint64_t)value);
-    return value;
-}
-
-lldb::ByteOrder
-SBData::GetByteOrder ()
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    lldb::ByteOrder value = eByteOrderInvalid;
-    if (m_opaque_sp.get())
-        value = m_opaque_sp->GetByteOrder();
-    if (log)
-        log->Printf ("SBData::GetByteOrder () => "
-                     "(%i)", value);
-    return value;
-}
-
-void
-SBData::SetByteOrder (lldb::ByteOrder endian)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (m_opaque_sp.get())
-        m_opaque_sp->SetByteOrder(endian);
-    if (log)
-        log->Printf ("SBData::GetByteOrder (%i)", endian);
-}
+SBData::SBData(const SBData &rhs) : m_opaque_sp(rhs.m_opaque_sp) {}
 
+const SBData &SBData::operator=(const SBData &rhs) {
+  if (this != &rhs)
+    m_opaque_sp = rhs.m_opaque_sp;
+  return *this;
+}
+
+SBData::~SBData() {}
+
+void SBData::SetOpaque(const lldb::DataExtractorSP &data_sp) {
+  m_opaque_sp = data_sp;
+}
+
+lldb_private::DataExtractor *SBData::get() const { return m_opaque_sp.get(); }
+
+lldb_private::DataExtractor *SBData::operator->() const {
+  return m_opaque_sp.operator->();
+}
+
+lldb::DataExtractorSP &SBData::operator*() { return m_opaque_sp; }
+
+const lldb::DataExtractorSP &SBData::operator*() const { return m_opaque_sp; }
+
+bool SBData::IsValid() { return m_opaque_sp.get() != NULL; }
+
+uint8_t SBData::GetAddressByteSize() {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  uint8_t value = 0;
+  if (m_opaque_sp.get())
+    value = m_opaque_sp->GetAddressByteSize();
+  if (log)
+    log->Printf("SBData::GetAddressByteSize () => "
+                "(%i)",
+                value);
+  return value;
+}
+
+void SBData::SetAddressByteSize(uint8_t addr_byte_size) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (m_opaque_sp.get())
+    m_opaque_sp->SetAddressByteSize(addr_byte_size);
+  if (log)
+    log->Printf("SBData::SetAddressByteSize (%i)", addr_byte_size);
+}
+
+void SBData::Clear() {
+  if (m_opaque_sp.get())
+    m_opaque_sp->Clear();
+}
+
+size_t SBData::GetByteSize() {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  size_t value = 0;
+  if (m_opaque_sp.get())
+    value = m_opaque_sp->GetByteSize();
+  if (log)
+    log->Printf("SBData::GetByteSize () => "
+                "( %" PRIu64 " )",
+                (uint64_t)value);
+  return value;
+}
+
+lldb::ByteOrder SBData::GetByteOrder() {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  lldb::ByteOrder value = eByteOrderInvalid;
+  if (m_opaque_sp.get())
+    value = m_opaque_sp->GetByteOrder();
+  if (log)
+    log->Printf("SBData::GetByteOrder () => "
+                "(%i)",
+                value);
+  return value;
+}
+
+void SBData::SetByteOrder(lldb::ByteOrder endian) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (m_opaque_sp.get())
+    m_opaque_sp->SetByteOrder(endian);
+  if (log)
+    log->Printf("SBData::GetByteOrder (%i)", endian);
+}
+
+float SBData::GetFloat(lldb::SBError &error, lldb::offset_t offset) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  float value = 0;
+  if (!m_opaque_sp.get()) {
+    error.SetErrorString("no value to read from");
+  } else {
+    uint32_t old_offset = offset;
+    value = m_opaque_sp->GetFloat(&offset);
+    if (offset == old_offset)
+      error.SetErrorString("unable to read data");
+  }
+  if (log)
+    log->Printf("SBData::GetFloat (error=%p,offset=%" PRIu64 ") => (%f)",
+                static_cast<void *>(error.get()), offset, value);
+  return value;
+}
+
+double SBData::GetDouble(lldb::SBError &error, lldb::offset_t offset) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  double value = 0;
+  if (!m_opaque_sp.get()) {
+    error.SetErrorString("no value to read from");
+  } else {
+    uint32_t old_offset = offset;
+    value = m_opaque_sp->GetDouble(&offset);
+    if (offset == old_offset)
+      error.SetErrorString("unable to read data");
+  }
+  if (log)
+    log->Printf("SBData::GetDouble (error=%p,offset=%" PRIu64 ") => "
+                "(%f)",
+                static_cast<void *>(error.get()), offset, value);
+  return value;
+}
+
+long double SBData::GetLongDouble(lldb::SBError &error, lldb::offset_t offset) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  long double value = 0;
+  if (!m_opaque_sp.get()) {
+    error.SetErrorString("no value to read from");
+  } else {
+    uint32_t old_offset = offset;
+    value = m_opaque_sp->GetLongDouble(&offset);
+    if (offset == old_offset)
+      error.SetErrorString("unable to read data");
+  }
+  if (log)
+    log->Printf("SBData::GetLongDouble (error=%p,offset=%" PRIu64 ") => "
+                "(%Lf)",
+                static_cast<void *>(error.get()), offset, value);
+  return value;
+}
+
+lldb::addr_t SBData::GetAddress(lldb::SBError &error, lldb::offset_t offset) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  lldb::addr_t value = 0;
+  if (!m_opaque_sp.get()) {
+    error.SetErrorString("no value to read from");
+  } else {
+    uint32_t old_offset = offset;
+    value = m_opaque_sp->GetAddress(&offset);
+    if (offset == old_offset)
+      error.SetErrorString("unable to read data");
+  }
+  if (log)
+    log->Printf("SBData::GetAddress (error=%p,offset=%" PRIu64 ") => "
+                "(%p)",
+                static_cast<void *>(error.get()), offset,
+                reinterpret_cast<void *>(value));
+  return value;
+}
+
+uint8_t SBData::GetUnsignedInt8(lldb::SBError &error, lldb::offset_t offset) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  uint8_t value = 0;
+  if (!m_opaque_sp.get()) {
+    error.SetErrorString("no value to read from");
+  } else {
+    uint32_t old_offset = offset;
+    value = m_opaque_sp->GetU8(&offset);
+    if (offset == old_offset)
+      error.SetErrorString("unable to read data");
+  }
+  if (log)
+    log->Printf("SBData::GetUnsignedInt8 (error=%p,offset=%" PRIu64 ") => "
+                "(%c)",
+                static_cast<void *>(error.get()), offset, value);
+  return value;
+}
+
+uint16_t SBData::GetUnsignedInt16(lldb::SBError &error, lldb::offset_t offset) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  uint16_t value = 0;
+  if (!m_opaque_sp.get()) {
+    error.SetErrorString("no value to read from");
+  } else {
+    uint32_t old_offset = offset;
+    value = m_opaque_sp->GetU16(&offset);
+    if (offset == old_offset)
+      error.SetErrorString("unable to read data");
+  }
+  if (log)
+    log->Printf("SBData::GetUnsignedInt16 (error=%p,offset=%" PRIu64 ") => "
+                "(%hd)",
+                static_cast<void *>(error.get()), offset, value);
+  return value;
+}
+
+uint32_t SBData::GetUnsignedInt32(lldb::SBError &error, lldb::offset_t offset) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  uint32_t value = 0;
+  if (!m_opaque_sp.get()) {
+    error.SetErrorString("no value to read from");
+  } else {
+    uint32_t old_offset = offset;
+    value = m_opaque_sp->GetU32(&offset);
+    if (offset == old_offset)
+      error.SetErrorString("unable to read data");
+  }
+  if (log)
+    log->Printf("SBData::GetUnsignedInt32 (error=%p,offset=%" PRIu64 ") => "
+                "(%d)",
+                static_cast<void *>(error.get()), offset, value);
+  return value;
+}
+
+uint64_t SBData::GetUnsignedInt64(lldb::SBError &error, lldb::offset_t offset) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  uint64_t value = 0;
+  if (!m_opaque_sp.get()) {
+    error.SetErrorString("no value to read from");
+  } else {
+    uint32_t old_offset = offset;
+    value = m_opaque_sp->GetU64(&offset);
+    if (offset == old_offset)
+      error.SetErrorString("unable to read data");
+  }
+  if (log)
+    log->Printf("SBData::GetUnsignedInt64 (error=%p,offset=%" PRIu64 ") => "
+                "(%" PRId64 ")",
+                static_cast<void *>(error.get()), offset, value);
+  return value;
+}
+
+int8_t SBData::GetSignedInt8(lldb::SBError &error, lldb::offset_t offset) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  int8_t value = 0;
+  if (!m_opaque_sp.get()) {
+    error.SetErrorString("no value to read from");
+  } else {
+    uint32_t old_offset = offset;
+    value = (int8_t)m_opaque_sp->GetMaxS64(&offset, 1);
+    if (offset == old_offset)
+      error.SetErrorString("unable to read data");
+  }
+  if (log)
+    log->Printf("SBData::GetSignedInt8 (error=%p,offset=%" PRIu64 ") => "
+                "(%c)",
+                static_cast<void *>(error.get()), offset, value);
+  return value;
+}
+
+int16_t SBData::GetSignedInt16(lldb::SBError &error, lldb::offset_t offset) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  int16_t value = 0;
+  if (!m_opaque_sp.get()) {
+    error.SetErrorString("no value to read from");
+  } else {
+    uint32_t old_offset = offset;
+    value = (int16_t)m_opaque_sp->GetMaxS64(&offset, 2);
+    if (offset == old_offset)
+      error.SetErrorString("unable to read data");
+  }
+  if (log)
+    log->Printf("SBData::GetSignedInt16 (error=%p,offset=%" PRIu64 ") => "
+                "(%hd)",
+                static_cast<void *>(error.get()), offset, value);
+  return value;
+}
+
+int32_t SBData::GetSignedInt32(lldb::SBError &error, lldb::offset_t offset) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  int32_t value = 0;
+  if (!m_opaque_sp.get()) {
+    error.SetErrorString("no value to read from");
+  } else {
+    uint32_t old_offset = offset;
+    value = (int32_t)m_opaque_sp->GetMaxS64(&offset, 4);
+    if (offset == old_offset)
+      error.SetErrorString("unable to read data");
+  }
+  if (log)
+    log->Printf("SBData::GetSignedInt32 (error=%p,offset=%" PRIu64 ") => "
+                "(%d)",
+                static_cast<void *>(error.get()), offset, value);
+  return value;
+}
+
+int64_t SBData::GetSignedInt64(lldb::SBError &error, lldb::offset_t offset) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  int64_t value = 0;
+  if (!m_opaque_sp.get()) {
+    error.SetErrorString("no value to read from");
+  } else {
+    uint32_t old_offset = offset;
+    value = (int64_t)m_opaque_sp->GetMaxS64(&offset, 8);
+    if (offset == old_offset)
+      error.SetErrorString("unable to read data");
+  }
+  if (log)
+    log->Printf("SBData::GetSignedInt64 (error=%p,offset=%" PRIu64 ") => "
+                "(%" PRId64 ")",
+                static_cast<void *>(error.get()), offset, value);
+  return value;
+}
+
+const char *SBData::GetString(lldb::SBError &error, lldb::offset_t offset) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  const char *value = 0;
+  if (!m_opaque_sp.get()) {
+    error.SetErrorString("no value to read from");
+  } else {
+    uint32_t old_offset = offset;
+    value = m_opaque_sp->GetCStr(&offset);
+    if (offset == old_offset || (value == NULL))
+      error.SetErrorString("unable to read data");
+  }
+  if (log)
+    log->Printf("SBData::GetString (error=%p,offset=%" PRIu64 ") => (%p)",
+                static_cast<void *>(error.get()), offset,
+                static_cast<const void *>(value));
+  return value;
+}
+
+bool SBData::GetDescription(lldb::SBStream &description,
+                            lldb::addr_t base_addr) {
+  Stream &strm = description.ref();
+
+  if (m_opaque_sp) {
+    m_opaque_sp->Dump(&strm, 0, lldb::eFormatBytesWithASCII, 1,
+                      m_opaque_sp->GetByteSize(), 16, base_addr, 0, 0);
+  } else
+    strm.PutCString("No value");
+
+  return true;
+}
+
+size_t SBData::ReadRawData(lldb::SBError &error, lldb::offset_t offset,
+                           void *buf, size_t size) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  void *ok = NULL;
+  if (!m_opaque_sp.get()) {
+    error.SetErrorString("no value to read from");
+  } else {
+    uint32_t old_offset = offset;
+    ok = m_opaque_sp->GetU8(&offset, buf, size);
+    if ((offset == old_offset) || (ok == NULL))
+      error.SetErrorString("unable to read data");
+  }
+  if (log)
+    log->Printf("SBData::ReadRawData (error=%p,offset=%" PRIu64
+                ",buf=%p,size=%" PRIu64 ") => "
+                "(%p)",
+                static_cast<void *>(error.get()), offset,
+                static_cast<void *>(buf), static_cast<uint64_t>(size),
+                static_cast<void *>(ok));
+  return ok ? size : 0;
+}
+
+void SBData::SetData(lldb::SBError &error, const void *buf, size_t size,
+                     lldb::ByteOrder endian, uint8_t addr_size) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (!m_opaque_sp.get())
+    m_opaque_sp.reset(new DataExtractor(buf, size, endian, addr_size));
+  else
+    m_opaque_sp->SetData(buf, size, endian);
+  if (log)
+    log->Printf("SBData::SetData (error=%p,buf=%p,size=%" PRIu64
+                ",endian=%d,addr_size=%c) => "
+                "(%p)",
+                static_cast<void *>(error.get()),
+                static_cast<const void *>(buf), static_cast<uint64_t>(size),
+                endian, addr_size, static_cast<void *>(m_opaque_sp.get()));
+}
+
+bool SBData::Append(const SBData &rhs) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  bool value = false;
+  if (m_opaque_sp.get() && rhs.m_opaque_sp.get())
+    value = m_opaque_sp.get()->Append(*rhs.m_opaque_sp);
+  if (log)
+    log->Printf("SBData::Append (rhs=%p) => (%s)",
+                static_cast<void *>(rhs.get()), value ? "true" : "false");
+  return value;
+}
+
+lldb::SBData SBData::CreateDataFromCString(lldb::ByteOrder endian,
+                                           uint32_t addr_byte_size,
+                                           const char *data) {
+  if (!data || !data[0])
+    return SBData();
+
+  uint32_t data_len = strlen(data);
+
+  lldb::DataBufferSP buffer_sp(new DataBufferHeap(data, data_len));
+  lldb::DataExtractorSP data_sp(
+      new DataExtractor(buffer_sp, endian, addr_byte_size));
+
+  SBData ret(data_sp);
+
+  return ret;
+}
+
+lldb::SBData SBData::CreateDataFromUInt64Array(lldb::ByteOrder endian,
+                                               uint32_t addr_byte_size,
+                                               uint64_t *array,
+                                               size_t array_len) {
+  if (!array || array_len == 0)
+    return SBData();
+
+  size_t data_len = array_len * sizeof(uint64_t);
+
+  lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+  lldb::DataExtractorSP data_sp(
+      new DataExtractor(buffer_sp, endian, addr_byte_size));
+
+  SBData ret(data_sp);
+
+  return ret;
+}
+
+lldb::SBData SBData::CreateDataFromUInt32Array(lldb::ByteOrder endian,
+                                               uint32_t addr_byte_size,
+                                               uint32_t *array,
+                                               size_t array_len) {
+  if (!array || array_len == 0)
+    return SBData();
+
+  size_t data_len = array_len * sizeof(uint32_t);
+
+  lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+  lldb::DataExtractorSP data_sp(
+      new DataExtractor(buffer_sp, endian, addr_byte_size));
+
+  SBData ret(data_sp);
+
+  return ret;
+}
+
+lldb::SBData SBData::CreateDataFromSInt64Array(lldb::ByteOrder endian,
+                                               uint32_t addr_byte_size,
+                                               int64_t *array,
+                                               size_t array_len) {
+  if (!array || array_len == 0)
+    return SBData();
+
+  size_t data_len = array_len * sizeof(int64_t);
+
+  lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+  lldb::DataExtractorSP data_sp(
+      new DataExtractor(buffer_sp, endian, addr_byte_size));
+
+  SBData ret(data_sp);
+
+  return ret;
+}
+
+lldb::SBData SBData::CreateDataFromSInt32Array(lldb::ByteOrder endian,
+                                               uint32_t addr_byte_size,
+                                               int32_t *array,
+                                               size_t array_len) {
+  if (!array || array_len == 0)
+    return SBData();
+
+  size_t data_len = array_len * sizeof(int32_t);
+
+  lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+  lldb::DataExtractorSP data_sp(
+      new DataExtractor(buffer_sp, endian, addr_byte_size));
+
+  SBData ret(data_sp);
+
+  return ret;
+}
+
+lldb::SBData SBData::CreateDataFromDoubleArray(lldb::ByteOrder endian,
+                                               uint32_t addr_byte_size,
+                                               double *array,
+                                               size_t array_len) {
+  if (!array || array_len == 0)
+    return SBData();
+
+  size_t data_len = array_len * sizeof(double);
+
+  lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+  lldb::DataExtractorSP data_sp(
+      new DataExtractor(buffer_sp, endian, addr_byte_size));
+
+  SBData ret(data_sp);
+
+  return ret;
+}
+
+bool SBData::SetDataFromCString(const char *data) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (!data) {
+    if (log)
+      log->Printf("SBData::SetDataFromCString (data=%p) => false",
+                  static_cast<const void *>(data));
+    return false;
+  }
+
+  size_t data_len = strlen(data);
+
+  lldb::DataBufferSP buffer_sp(new DataBufferHeap(data, data_len));
+
+  if (!m_opaque_sp.get())
+    m_opaque_sp.reset(
+        new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
+  else
+    m_opaque_sp->SetData(buffer_sp);
+
+  if (log)
+    log->Printf("SBData::SetDataFromCString (data=%p) => true",
+                static_cast<const void *>(data));
+
+  return true;
+}
+
+bool SBData::SetDataFromUInt64Array(uint64_t *array, size_t array_len) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (!array || array_len == 0) {
+    if (log)
+      log->Printf(
+          "SBData::SetDataFromUInt64Array (array=%p, array_len = %" PRIu64
+          ") => "
+          "false",
+          static_cast<void *>(array), static_cast<uint64_t>(array_len));
+    return false;
+  }
+
+  size_t data_len = array_len * sizeof(uint64_t);
+
+  lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+
+  if (!m_opaque_sp.get())
+    m_opaque_sp.reset(
+        new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
+  else
+    m_opaque_sp->SetData(buffer_sp);
+
+  if (log)
+    log->Printf("SBData::SetDataFromUInt64Array (array=%p, array_len = %" PRIu64
+                ") => "
+                "true",
+                static_cast<void *>(array), static_cast<uint64_t>(array_len));
+
+  return true;
+}
+
+bool SBData::SetDataFromUInt32Array(uint32_t *array, size_t array_len) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (!array || array_len == 0) {
+    if (log)
+      log->Printf(
+          "SBData::SetDataFromUInt32Array (array=%p, array_len = %" PRIu64
+          ") => "
+          "false",
+          static_cast<void *>(array), static_cast<uint64_t>(array_len));
+    return false;
+  }
+
+  size_t data_len = array_len * sizeof(uint32_t);
+
+  lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+
+  if (!m_opaque_sp.get())
+    m_opaque_sp.reset(
+        new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
+  else
+    m_opaque_sp->SetData(buffer_sp);
+
+  if (log)
+    log->Printf("SBData::SetDataFromUInt32Array (array=%p, array_len = %" PRIu64
+                ") => "
+                "true",
+                static_cast<void *>(array), static_cast<uint64_t>(array_len));
+
+  return true;
+}
+
+bool SBData::SetDataFromSInt64Array(int64_t *array, size_t array_len) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (!array || array_len == 0) {
+    if (log)
+      log->Printf(
+          "SBData::SetDataFromSInt64Array (array=%p, array_len = %" PRIu64
+          ") => "
+          "false",
+          static_cast<void *>(array), static_cast<uint64_t>(array_len));
+    return false;
+  }
+
+  size_t data_len = array_len * sizeof(int64_t);
+
+  lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+
+  if (!m_opaque_sp.get())
+    m_opaque_sp.reset(
+        new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
+  else
+    m_opaque_sp->SetData(buffer_sp);
+
+  if (log)
+    log->Printf("SBData::SetDataFromSInt64Array (array=%p, array_len = %" PRIu64
+                ") => "
+                "true",
+                static_cast<void *>(array), static_cast<uint64_t>(array_len));
+
+  return true;
+}
+
+bool SBData::SetDataFromSInt32Array(int32_t *array, size_t array_len) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (!array || array_len == 0) {
+    if (log)
+      log->Printf(
+          "SBData::SetDataFromSInt32Array (array=%p, array_len = %" PRIu64
+          ") => "
+          "false",
+          static_cast<void *>(array), static_cast<uint64_t>(array_len));
+    return false;
+  }
+
+  size_t data_len = array_len * sizeof(int32_t);
+
+  lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+
+  if (!m_opaque_sp.get())
+    m_opaque_sp.reset(
+        new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
+  else
+    m_opaque_sp->SetData(buffer_sp);
+
+  if (log)
+    log->Printf("SBData::SetDataFromSInt32Array (array=%p, array_len = %" PRIu64
+                ") => "
+                "true",
+                static_cast<void *>(array), static_cast<uint64_t>(array_len));
+
+  return true;
+}
+
+bool SBData::SetDataFromDoubleArray(double *array, size_t array_len) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (!array || array_len == 0) {
+    if (log)
+      log->Printf(
+          "SBData::SetDataFromDoubleArray (array=%p, array_len = %" PRIu64
+          ") => "
+          "false",
+          static_cast<void *>(array), static_cast<uint64_t>(array_len));
+    return false;
+  }
+
+  size_t data_len = array_len * sizeof(double);
+
+  lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+
+  if (!m_opaque_sp.get())
+    m_opaque_sp.reset(
+        new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
+  else
+    m_opaque_sp->SetData(buffer_sp);
+
+  if (log)
+    log->Printf("SBData::SetDataFromDoubleArray (array=%p, array_len = %" PRIu64
+                ") => "
+                "true",
+                static_cast<void *>(array), static_cast<uint64_t>(array_len));
 
-float
-SBData::GetFloat (lldb::SBError& error, lldb::offset_t offset)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    float value = 0;
-    if (!m_opaque_sp.get())
-    {
-        error.SetErrorString("no value to read from");
-    }
-    else
-    {
-        uint32_t old_offset = offset;
-        value = m_opaque_sp->GetFloat(&offset);
-        if (offset == old_offset)
-            error.SetErrorString("unable to read data");
-    }
-    if (log)
-        log->Printf ("SBData::GetFloat (error=%p,offset=%" PRIu64 ") => (%f)",
-                     static_cast<void*>(error.get()), offset, value);
-    return value;
-}
-
-double
-SBData::GetDouble (lldb::SBError& error, lldb::offset_t offset)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    double value = 0;
-    if (!m_opaque_sp.get())
-    {
-        error.SetErrorString("no value to read from");
-    }
-    else
-    {
-        uint32_t old_offset = offset;
-        value = m_opaque_sp->GetDouble(&offset);
-        if (offset == old_offset)
-            error.SetErrorString("unable to read data");
-    }
-    if (log)
-        log->Printf ("SBData::GetDouble (error=%p,offset=%" PRIu64 ") => "
-                     "(%f)", static_cast<void*>(error.get()), offset, value);
-    return value;
-}
-
-long double
-SBData::GetLongDouble (lldb::SBError& error, lldb::offset_t offset)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    long double value = 0;
-    if (!m_opaque_sp.get())
-    {
-        error.SetErrorString("no value to read from");
-    }
-    else
-    {
-        uint32_t old_offset = offset;
-        value = m_opaque_sp->GetLongDouble(&offset);
-        if (offset == old_offset)
-            error.SetErrorString("unable to read data");
-    }
-    if (log)
-        log->Printf ("SBData::GetLongDouble (error=%p,offset=%" PRIu64 ") => "
-                     "(%Lf)", static_cast<void*>(error.get()), offset, value);
-    return value;
-}
-
-lldb::addr_t
-SBData::GetAddress (lldb::SBError& error, lldb::offset_t offset)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    lldb::addr_t value = 0;
-    if (!m_opaque_sp.get())
-    {
-        error.SetErrorString("no value to read from");
-    }
-    else
-    {
-        uint32_t old_offset = offset;
-        value = m_opaque_sp->GetAddress(&offset);
-        if (offset == old_offset)
-            error.SetErrorString("unable to read data");
-    }
-    if (log)
-        log->Printf ("SBData::GetAddress (error=%p,offset=%" PRIu64 ") => "
-                     "(%p)", static_cast<void*>(error.get()), offset,
-                     reinterpret_cast<void*>(value));
-    return value;
-}
-
-uint8_t
-SBData::GetUnsignedInt8 (lldb::SBError& error, lldb::offset_t offset)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    uint8_t value = 0;
-    if (!m_opaque_sp.get())
-    {
-        error.SetErrorString("no value to read from");
-    }
-    else
-    {
-        uint32_t old_offset = offset;
-        value = m_opaque_sp->GetU8(&offset);
-        if (offset == old_offset)
-            error.SetErrorString("unable to read data");
-    }
-    if (log)
-        log->Printf ("SBData::GetUnsignedInt8 (error=%p,offset=%" PRIu64 ") => "
-                     "(%c)", static_cast<void*>(error.get()), offset, value);
-    return value;
-}
-
-uint16_t
-SBData::GetUnsignedInt16 (lldb::SBError& error, lldb::offset_t offset)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    uint16_t value = 0;
-    if (!m_opaque_sp.get())
-    {
-        error.SetErrorString("no value to read from");
-    }
-    else
-    {
-        uint32_t old_offset = offset;
-        value = m_opaque_sp->GetU16(&offset);
-        if (offset == old_offset)
-            error.SetErrorString("unable to read data");
-    }
-    if (log)
-        log->Printf ("SBData::GetUnsignedInt16 (error=%p,offset=%" PRIu64 ") => "
-                     "(%hd)", static_cast<void*>(error.get()), offset, value);
-    return value;
-}
-
-uint32_t
-SBData::GetUnsignedInt32 (lldb::SBError& error, lldb::offset_t offset)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    uint32_t value = 0;
-    if (!m_opaque_sp.get())
-    {
-        error.SetErrorString("no value to read from");
-    }
-    else
-    {
-        uint32_t old_offset = offset;
-        value = m_opaque_sp->GetU32(&offset);
-        if (offset == old_offset)
-            error.SetErrorString("unable to read data");
-    }
-    if (log)
-        log->Printf ("SBData::GetUnsignedInt32 (error=%p,offset=%" PRIu64 ") => "
-                     "(%d)", static_cast<void*>(error.get()), offset, value);
-    return value;
-}
-
-uint64_t
-SBData::GetUnsignedInt64 (lldb::SBError& error, lldb::offset_t offset)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    uint64_t value = 0;
-    if (!m_opaque_sp.get())
-    {
-        error.SetErrorString("no value to read from");
-    }
-    else
-    {
-        uint32_t old_offset = offset;
-        value = m_opaque_sp->GetU64(&offset);
-        if (offset == old_offset)
-            error.SetErrorString("unable to read data");
-    }
-    if (log)
-        log->Printf ("SBData::GetUnsignedInt64 (error=%p,offset=%" PRIu64 ") => "
-                     "(%" PRId64 ")", static_cast<void*>(error.get()), offset,
-                     value);
-    return value;
-}
-
-int8_t
-SBData::GetSignedInt8 (lldb::SBError& error, lldb::offset_t offset)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    int8_t value = 0;
-    if (!m_opaque_sp.get())
-    {
-        error.SetErrorString("no value to read from");
-    }
-    else
-    {
-        uint32_t old_offset = offset;
-        value = (int8_t)m_opaque_sp->GetMaxS64(&offset, 1);
-        if (offset == old_offset)
-            error.SetErrorString("unable to read data");
-    }
-    if (log)
-        log->Printf ("SBData::GetSignedInt8 (error=%p,offset=%" PRIu64 ") => "
-                     "(%c)", static_cast<void*>(error.get()), offset, value);
-    return value;
-}
-
-int16_t
-SBData::GetSignedInt16 (lldb::SBError& error, lldb::offset_t offset)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    int16_t value = 0;
-    if (!m_opaque_sp.get())
-    {
-        error.SetErrorString("no value to read from");
-    }
-    else
-    {
-        uint32_t old_offset = offset;
-        value = (int16_t)m_opaque_sp->GetMaxS64(&offset, 2);
-        if (offset == old_offset)
-            error.SetErrorString("unable to read data");
-    }
-    if (log)
-        log->Printf ("SBData::GetSignedInt16 (error=%p,offset=%" PRIu64 ") => "
-                     "(%hd)", static_cast<void*>(error.get()), offset, value);
-    return value;
-}
-
-int32_t
-SBData::GetSignedInt32 (lldb::SBError& error, lldb::offset_t offset)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    int32_t value = 0;
-    if (!m_opaque_sp.get())
-    {
-        error.SetErrorString("no value to read from");
-    }
-    else
-    {
-        uint32_t old_offset = offset;
-        value = (int32_t)m_opaque_sp->GetMaxS64(&offset, 4);
-        if (offset == old_offset)
-            error.SetErrorString("unable to read data");
-    }
-    if (log)
-        log->Printf ("SBData::GetSignedInt32 (error=%p,offset=%" PRIu64 ") => "
-                     "(%d)", static_cast<void*>(error.get()), offset, value);
-    return value;
-}
-
-int64_t
-SBData::GetSignedInt64 (lldb::SBError& error, lldb::offset_t offset)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    int64_t value = 0;
-    if (!m_opaque_sp.get())
-    {
-        error.SetErrorString("no value to read from");
-    }
-    else
-    {
-        uint32_t old_offset = offset;
-        value = (int64_t)m_opaque_sp->GetMaxS64(&offset, 8);
-        if (offset == old_offset)
-            error.SetErrorString("unable to read data");
-    }
-    if (log)
-        log->Printf ("SBData::GetSignedInt64 (error=%p,offset=%" PRIu64 ") => "
-                     "(%" PRId64 ")", static_cast<void*>(error.get()), offset,
-                     value);
-    return value;
-}
-
-const char*
-SBData::GetString (lldb::SBError& error, lldb::offset_t offset)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    const char* value = 0;
-    if (!m_opaque_sp.get())
-    {
-        error.SetErrorString("no value to read from");
-    }
-    else
-    {
-        uint32_t old_offset = offset;
-        value = m_opaque_sp->GetCStr(&offset);
-        if (offset == old_offset || (value == NULL))
-            error.SetErrorString("unable to read data");
-    }
-    if (log)
-        log->Printf ("SBData::GetString (error=%p,offset=%" PRIu64 ") => (%p)",
-                     static_cast<void*>(error.get()), offset,
-                     static_cast<const void*>(value));
-    return value;
-}
-
-bool
-SBData::GetDescription (lldb::SBStream &description, lldb::addr_t base_addr)
-{
-    Stream &strm = description.ref();
-
-    if (m_opaque_sp)
-    {
-        m_opaque_sp->Dump (&strm,
-                           0,
-                           lldb::eFormatBytesWithASCII,
-                           1,
-                           m_opaque_sp->GetByteSize(),
-                           16,
-                           base_addr,
-                           0,
-                           0);
-    }
-    else
-        strm.PutCString ("No value");
-    
-    return true;
-}
-
-size_t
-SBData::ReadRawData (lldb::SBError& error,
-                     lldb::offset_t offset,
-                     void *buf,
-                     size_t size)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    void* ok = NULL;
-    if (!m_opaque_sp.get())
-    {
-        error.SetErrorString("no value to read from");
-    }
-    else
-    {
-        uint32_t old_offset = offset;
-        ok = m_opaque_sp->GetU8(&offset, buf, size);
-        if ((offset == old_offset) || (ok == NULL))
-            error.SetErrorString("unable to read data");
-    }
-    if (log)
-        log->Printf("SBData::ReadRawData (error=%p,offset=%" PRIu64 ",buf=%p,size=%" PRIu64 ") => "
-                    "(%p)", static_cast<void*>(error.get()), offset,
-                    static_cast<void*>(buf), static_cast<uint64_t>(size),
-                    static_cast<void*>(ok));
-    return ok ? size : 0;
-}
-
-void
-SBData::SetData (lldb::SBError& error,
-                 const void *buf,
-                 size_t size,
-                 lldb::ByteOrder endian,
-                 uint8_t addr_size)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (!m_opaque_sp.get())
-        m_opaque_sp.reset(new DataExtractor(buf, size, endian, addr_size));
-    else
-        m_opaque_sp->SetData(buf, size, endian);
-    if (log)
-        log->Printf("SBData::SetData (error=%p,buf=%p,size=%" PRIu64 ",endian=%d,addr_size=%c) => "
-                    "(%p)", static_cast<void*>(error.get()),
-                    static_cast<const void*>(buf), static_cast<uint64_t>(size),
-                    endian, addr_size, static_cast<void*>(m_opaque_sp.get()));
-}
-
-bool
-SBData::Append (const SBData& rhs)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    bool value = false;
-    if (m_opaque_sp.get() && rhs.m_opaque_sp.get())
-        value = m_opaque_sp.get()->Append(*rhs.m_opaque_sp);
-    if (log)
-        log->Printf ("SBData::Append (rhs=%p) => (%s)",
-                     static_cast<void*>(rhs.get()), value ? "true" : "false");
-    return value;
-}
-
-lldb::SBData
-SBData::CreateDataFromCString (lldb::ByteOrder endian, uint32_t addr_byte_size, const char* data)
-{
-    if (!data || !data[0])
-        return SBData();
-    
-    uint32_t data_len = strlen(data);
-    
-    lldb::DataBufferSP buffer_sp(new DataBufferHeap(data, data_len));
-    lldb::DataExtractorSP data_sp(new DataExtractor(buffer_sp, endian, addr_byte_size));
-    
-    SBData ret(data_sp);
-    
-    return ret;
-}
-
-lldb::SBData
-SBData::CreateDataFromUInt64Array (lldb::ByteOrder endian, uint32_t addr_byte_size, uint64_t* array, size_t array_len)
-{
-    if (!array || array_len == 0)
-        return SBData();
-    
-    size_t data_len = array_len * sizeof(uint64_t);
-    
-    lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
-    lldb::DataExtractorSP data_sp(new DataExtractor(buffer_sp, endian, addr_byte_size));
-    
-    SBData ret(data_sp);
-    
-    return ret;
-}
-
-lldb::SBData
-SBData::CreateDataFromUInt32Array (lldb::ByteOrder endian, uint32_t addr_byte_size, uint32_t* array, size_t array_len)
-{
-    if (!array || array_len == 0)
-        return SBData();
-    
-    size_t data_len = array_len * sizeof(uint32_t);
-    
-    lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
-    lldb::DataExtractorSP data_sp(new DataExtractor(buffer_sp, endian, addr_byte_size));
-    
-    SBData ret(data_sp);
-    
-    return ret;
-}
-
-lldb::SBData
-SBData::CreateDataFromSInt64Array (lldb::ByteOrder endian, uint32_t addr_byte_size, int64_t* array, size_t array_len)
-{
-    if (!array || array_len == 0)
-        return SBData();
-    
-    size_t data_len = array_len * sizeof(int64_t);
-    
-    lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
-    lldb::DataExtractorSP data_sp(new DataExtractor(buffer_sp, endian, addr_byte_size));
-    
-    SBData ret(data_sp);
-    
-    return ret;
-}
-
-lldb::SBData
-SBData::CreateDataFromSInt32Array (lldb::ByteOrder endian, uint32_t addr_byte_size, int32_t* array, size_t array_len)
-{
-    if (!array || array_len == 0)
-        return SBData();
-    
-    size_t data_len = array_len * sizeof(int32_t);
-    
-    lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
-    lldb::DataExtractorSP data_sp(new DataExtractor(buffer_sp, endian, addr_byte_size));
-    
-    SBData ret(data_sp);
-    
-    return ret;
-}
-
-lldb::SBData
-SBData::CreateDataFromDoubleArray (lldb::ByteOrder endian, uint32_t addr_byte_size, double* array, size_t array_len)
-{
-    if (!array || array_len == 0)
-        return SBData();
-    
-    size_t data_len = array_len * sizeof(double);
-    
-    lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
-    lldb::DataExtractorSP data_sp(new DataExtractor(buffer_sp, endian, addr_byte_size));
-    
-    SBData ret(data_sp);
-    
-    return ret;
-}
-
-bool
-SBData::SetDataFromCString (const char* data)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (!data)
-    {
-        if (log)
-            log->Printf ("SBData::SetDataFromCString (data=%p) => false",
-                         static_cast<const void*>(data));
-        return false;
-    }
-
-    size_t data_len = strlen(data);
-
-    lldb::DataBufferSP buffer_sp(new DataBufferHeap(data, data_len));
-
-    if (!m_opaque_sp.get())
-        m_opaque_sp.reset(new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
-    else
-        m_opaque_sp->SetData(buffer_sp);
-
-    if (log)
-        log->Printf ("SBData::SetDataFromCString (data=%p) => true",
-                     static_cast<const void*>(data));
-
-    return true;
-}
-
-bool
-SBData::SetDataFromUInt64Array (uint64_t* array, size_t array_len)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (!array || array_len == 0)
-    {
-        if (log)
-            log->Printf("SBData::SetDataFromUInt64Array (array=%p, array_len = %" PRIu64 ") => "
-                        "false", static_cast<void*>(array),
-                        static_cast<uint64_t>(array_len));
-        return false;
-    }
-
-    size_t data_len = array_len * sizeof(uint64_t);
-
-    lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
-
-    if (!m_opaque_sp.get())
-        m_opaque_sp.reset(new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
-    else
-        m_opaque_sp->SetData(buffer_sp);
-
-    if (log)
-        log->Printf("SBData::SetDataFromUInt64Array (array=%p, array_len = %" PRIu64 ") => "
-                    "true", static_cast<void*>(array),
-                    static_cast<uint64_t>(array_len));
-
-    return true;
-}
-
-bool
-SBData::SetDataFromUInt32Array (uint32_t* array, size_t array_len)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (!array || array_len == 0)
-    {
-        if (log)
-            log->Printf("SBData::SetDataFromUInt32Array (array=%p, array_len = %" PRIu64 ") => "
-                        "false", static_cast<void*>(array),
-                        static_cast<uint64_t>(array_len));
-        return false;
-    }
-
-    size_t data_len = array_len * sizeof(uint32_t);
-
-    lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
-
-    if (!m_opaque_sp.get())
-        m_opaque_sp.reset(new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
-    else
-        m_opaque_sp->SetData(buffer_sp);
-
-    if (log)
-        log->Printf("SBData::SetDataFromUInt32Array (array=%p, array_len = %" PRIu64 ") => "
-                    "true", static_cast<void*>(array),
-                    static_cast<uint64_t>(array_len));
-
-    return true;
-}
-
-bool
-SBData::SetDataFromSInt64Array (int64_t* array, size_t array_len)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (!array || array_len == 0)
-    {
-        if (log)
-            log->Printf("SBData::SetDataFromSInt64Array (array=%p, array_len = %" PRIu64 ") => "
-                        "false", static_cast<void*>(array),
-                        static_cast<uint64_t>(array_len));
-        return false;
-    }
-
-    size_t data_len = array_len * sizeof(int64_t);
-
-    lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
-
-    if (!m_opaque_sp.get())
-        m_opaque_sp.reset(new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
-    else
-        m_opaque_sp->SetData(buffer_sp);
-
-    if (log)
-        log->Printf("SBData::SetDataFromSInt64Array (array=%p, array_len = %" PRIu64 ") => "
-                     "true", static_cast<void*>(array),
-                     static_cast<uint64_t>(array_len));
-
-    return true;
-}
-
-bool
-SBData::SetDataFromSInt32Array (int32_t* array, size_t array_len)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (!array || array_len == 0)
-    {
-        if (log)
-            log->Printf("SBData::SetDataFromSInt32Array (array=%p, array_len = %" PRIu64 ") => "
-                        "false", static_cast<void*>(array),
-                        static_cast<uint64_t>(array_len));
-        return false;
-    }
-
-    size_t data_len = array_len * sizeof(int32_t);
-
-    lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
-
-    if (!m_opaque_sp.get())
-        m_opaque_sp.reset(new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
-    else
-        m_opaque_sp->SetData(buffer_sp);
-
-    if (log)
-        log->Printf("SBData::SetDataFromSInt32Array (array=%p, array_len = %" PRIu64 ") => "
-                    "true", static_cast<void*>(array),
-                    static_cast<uint64_t>(array_len));
-
-    return true;
-}
-
-bool
-SBData::SetDataFromDoubleArray (double* array, size_t array_len)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (!array || array_len == 0)
-    {
-        if (log)
-            log->Printf("SBData::SetDataFromDoubleArray (array=%p, array_len = %" PRIu64 ") => "
-                        "false", static_cast<void*>(array),
-                        static_cast<uint64_t>(array_len));
-        return false;
-    }
-
-    size_t data_len = array_len * sizeof(double);
-
-    lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
-
-    if (!m_opaque_sp.get())
-        m_opaque_sp.reset(new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
-    else
-        m_opaque_sp->SetData(buffer_sp);
-
-    if (log)
-        log->Printf("SBData::SetDataFromDoubleArray (array=%p, array_len = %" PRIu64 ") => "
-                    "true", static_cast<void*>(array),
-                    static_cast<uint64_t>(array_len));
-
-    return true;
+  return true;
 }

Modified: lldb/trunk/source/API/SBDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBDebugger.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBDebugger.cpp (original)
+++ lldb/trunk/source/API/SBDebugger.cpp Tue Sep  6 15:57:50 2016
@@ -15,14 +15,13 @@
 
 #include "lldb/lldb-private.h"
 
-#include "lldb/API/SystemInitializerFull.h"
-#include "lldb/API/SBListener.h"
 #include "lldb/API/SBBroadcaster.h"
 #include "lldb/API/SBCommandInterpreter.h"
 #include "lldb/API/SBCommandReturnObject.h"
 #include "lldb/API/SBError.h"
 #include "lldb/API/SBEvent.h"
 #include "lldb/API/SBFrame.h"
+#include "lldb/API/SBListener.h"
 #include "lldb/API/SBProcess.h"
 #include "lldb/API/SBSourceManager.h"
 #include "lldb/API/SBStream.h"
@@ -30,11 +29,12 @@
 #include "lldb/API/SBTarget.h"
 #include "lldb/API/SBThread.h"
 #include "lldb/API/SBTypeCategory.h"
-#include "lldb/API/SBTypeFormat.h"
 #include "lldb/API/SBTypeFilter.h"
+#include "lldb/API/SBTypeFormat.h"
 #include "lldb/API/SBTypeNameSpecifier.h"
 #include "lldb/API/SBTypeSummary.h"
 #include "lldb/API/SBTypeSynthetic.h"
+#include "lldb/API/SystemInitializerFull.h"
 
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/State.h"
@@ -48,1335 +48,1090 @@
 #include "lldb/Target/TargetList.h"
 
 #include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/DynamicLibrary.h"
+#include "llvm/Support/ManagedStatic.h"
 
 using namespace lldb;
 using namespace lldb_private;
 
-static llvm::sys::DynamicLibrary
-LoadPlugin (const lldb::DebuggerSP &debugger_sp, const FileSpec& spec, Error& error)
-{
-    llvm::sys::DynamicLibrary dynlib = llvm::sys::DynamicLibrary::getPermanentLibrary(spec.GetPath().c_str());
-    if (dynlib.isValid())
-    {
-        typedef bool (*LLDBCommandPluginInit) (lldb::SBDebugger& debugger);
-        
-        lldb::SBDebugger debugger_sb(debugger_sp);
-        // This calls the bool lldb::PluginInitialize(lldb::SBDebugger debugger) function.
-        // TODO: mangle this differently for your system - on OSX, the first underscore needs to be removed and the second one stays
-        LLDBCommandPluginInit init_func = (LLDBCommandPluginInit)dynlib.getAddressOfSymbol("_ZN4lldb16PluginInitializeENS_10SBDebuggerE");
-        if (init_func)
-        {
-            if (init_func(debugger_sb))
-                return dynlib;
-            else
-                error.SetErrorString("plug-in refused to load (lldb::PluginInitialize(lldb::SBDebugger) returned false)");
-        }
-        else
-        {
-            error.SetErrorString("plug-in is missing the required initialization: lldb::PluginInitialize(lldb::SBDebugger)");
-        }
-    }
+static llvm::sys::DynamicLibrary LoadPlugin(const lldb::DebuggerSP &debugger_sp,
+                                            const FileSpec &spec,
+                                            Error &error) {
+  llvm::sys::DynamicLibrary dynlib =
+      llvm::sys::DynamicLibrary::getPermanentLibrary(spec.GetPath().c_str());
+  if (dynlib.isValid()) {
+    typedef bool (*LLDBCommandPluginInit)(lldb::SBDebugger & debugger);
+
+    lldb::SBDebugger debugger_sb(debugger_sp);
+    // This calls the bool lldb::PluginInitialize(lldb::SBDebugger debugger)
+    // function.
+    // TODO: mangle this differently for your system - on OSX, the first
+    // underscore needs to be removed and the second one stays
+    LLDBCommandPluginInit init_func =
+        (LLDBCommandPluginInit)dynlib.getAddressOfSymbol(
+            "_ZN4lldb16PluginInitializeENS_10SBDebuggerE");
+    if (init_func) {
+      if (init_func(debugger_sb))
+        return dynlib;
+      else
+        error.SetErrorString("plug-in refused to load "
+                             "(lldb::PluginInitialize(lldb::SBDebugger) "
+                             "returned false)");
+    } else {
+      error.SetErrorString("plug-in is missing the required initialization: "
+                           "lldb::PluginInitialize(lldb::SBDebugger)");
+    }
+  } else {
+    if (spec.Exists())
+      error.SetErrorString("this file does not represent a loadable dylib");
     else
-    {
-        if (spec.Exists())
-            error.SetErrorString("this file does not represent a loadable dylib");
-        else
-            error.SetErrorString("no such file");
-    }
-    return llvm::sys::DynamicLibrary();
+      error.SetErrorString("no such file");
+  }
+  return llvm::sys::DynamicLibrary();
 }
 
 static llvm::ManagedStatic<SystemLifetimeManager> g_debugger_lifetime;
 
-SBError
-SBInputReader::Initialize(lldb::SBDebugger &sb_debugger,
-                          unsigned long (*)(void *, lldb::SBInputReader *, lldb::InputReaderAction, char const *,
-                                            unsigned long),
-                          void *, lldb::InputReaderGranularity, char const *, char const *, bool)
-{
-    return SBError();
+SBError SBInputReader::Initialize(
+    lldb::SBDebugger &sb_debugger,
+    unsigned long (*)(void *, lldb::SBInputReader *, lldb::InputReaderAction,
+                      char const *, unsigned long),
+    void *, lldb::InputReaderGranularity, char const *, char const *, bool) {
+  return SBError();
 }
 
-void
-SBInputReader::SetIsDone(bool)
-{
-}
+void SBInputReader::SetIsDone(bool) {}
 
-bool
-SBInputReader::IsActive() const
-{
-    return false;
-}
+bool SBInputReader::IsActive() const { return false; }
 
 SBDebugger::SBDebugger() = default;
 
-SBDebugger::SBDebugger(const lldb::DebuggerSP &debugger_sp) :
-    m_opaque_sp(debugger_sp)
-{
-}
+SBDebugger::SBDebugger(const lldb::DebuggerSP &debugger_sp)
+    : m_opaque_sp(debugger_sp) {}
 
-SBDebugger::SBDebugger(const SBDebugger &rhs) :
-    m_opaque_sp (rhs.m_opaque_sp)
-{
-}
+SBDebugger::SBDebugger(const SBDebugger &rhs) : m_opaque_sp(rhs.m_opaque_sp) {}
 
 SBDebugger::~SBDebugger() = default;
 
-SBDebugger &
-SBDebugger::operator = (const SBDebugger &rhs)
-{
-    if (this != &rhs)
-    {
-        m_opaque_sp = rhs.m_opaque_sp;
-    }
-    return *this;
+SBDebugger &SBDebugger::operator=(const SBDebugger &rhs) {
+  if (this != &rhs) {
+    m_opaque_sp = rhs.m_opaque_sp;
+  }
+  return *this;
 }
 
-void
-SBDebugger::Initialize ()
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+void SBDebugger::Initialize() {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-    if (log)
-        log->Printf ("SBDebugger::Initialize ()");
+  if (log)
+    log->Printf("SBDebugger::Initialize ()");
 
-    g_debugger_lifetime->Initialize(llvm::make_unique<SystemInitializerFull>(), LoadPlugin);
+  g_debugger_lifetime->Initialize(llvm::make_unique<SystemInitializerFull>(),
+                                  LoadPlugin);
 }
 
-void
-SBDebugger::Terminate ()
-{
-    g_debugger_lifetime->Terminate();
-}
+void SBDebugger::Terminate() { g_debugger_lifetime->Terminate(); }
 
-void
-SBDebugger::Clear ()
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+void SBDebugger::Clear() {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-    if (log)
-        log->Printf ("SBDebugger(%p)::Clear ()",
-                     static_cast<void*>(m_opaque_sp.get()));
+  if (log)
+    log->Printf("SBDebugger(%p)::Clear ()",
+                static_cast<void *>(m_opaque_sp.get()));
 
-    if (m_opaque_sp)
-        m_opaque_sp->ClearIOHandlers ();
+  if (m_opaque_sp)
+    m_opaque_sp->ClearIOHandlers();
 
-    m_opaque_sp.reset();
+  m_opaque_sp.reset();
 }
 
-SBDebugger
-SBDebugger::Create()
-{
-    return SBDebugger::Create(false, nullptr, nullptr);
+SBDebugger SBDebugger::Create() {
+  return SBDebugger::Create(false, nullptr, nullptr);
 }
 
-SBDebugger
-SBDebugger::Create(bool source_init_files)
-{
-    return SBDebugger::Create (source_init_files, nullptr, nullptr);
+SBDebugger SBDebugger::Create(bool source_init_files) {
+  return SBDebugger::Create(source_init_files, nullptr, nullptr);
 }
 
-SBDebugger
-SBDebugger::Create(bool source_init_files, lldb::LogOutputCallback callback, void *baton)
+SBDebugger SBDebugger::Create(bool source_init_files,
+                              lldb::LogOutputCallback callback, void *baton)
 
 {
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-    SBDebugger debugger;
-    
-    // Currently we have issues if this function is called simultaneously on two different
-    // threads. The issues mainly revolve around the fact that the lldb_private::FormatManager
-    // uses global collections and having two threads parsing the .lldbinit files can cause
-    // mayhem. So to get around this for now we need to use a mutex to prevent bad things
-    // from happening.
-    static std::recursive_mutex g_mutex;
-    std::lock_guard<std::recursive_mutex> guard(g_mutex);
-
-    debugger.reset(Debugger::CreateInstance(callback, baton));
-
-    if (log)
-    {
-        SBStream sstr;
-        debugger.GetDescription (sstr);
-        log->Printf ("SBDebugger::Create () => SBDebugger(%p): %s",
-                     static_cast<void*>(debugger.m_opaque_sp.get()),
-                     sstr.GetData());
-    }
+  SBDebugger debugger;
 
-    SBCommandInterpreter interp = debugger.GetCommandInterpreter();
-    if (source_init_files)
-    {
-        interp.get()->SkipLLDBInitFiles(false);
-        interp.get()->SkipAppInitFiles (false);
-        SBCommandReturnObject result;
-        interp.SourceInitFileInHomeDirectory(result);
-    }
-    else
-    {
-        interp.get()->SkipLLDBInitFiles(true);
-        interp.get()->SkipAppInitFiles (true);
-    }
-    return debugger;
-}
-
-void
-SBDebugger::Destroy (SBDebugger &debugger)
-{
-    Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-    {
-        SBStream sstr;
-        debugger.GetDescription (sstr);
-        log->Printf ("SBDebugger::Destroy () => SBDebugger(%p): %s",
-                     static_cast<void*>(debugger.m_opaque_sp.get()),
-                     sstr.GetData());
-    }
-
-    Debugger::Destroy (debugger.m_opaque_sp);
+  // Currently we have issues if this function is called simultaneously on two
+  // different
+  // threads. The issues mainly revolve around the fact that the
+  // lldb_private::FormatManager
+  // uses global collections and having two threads parsing the .lldbinit files
+  // can cause
+  // mayhem. So to get around this for now we need to use a mutex to prevent bad
+  // things
+  // from happening.
+  static std::recursive_mutex g_mutex;
+  std::lock_guard<std::recursive_mutex> guard(g_mutex);
 
-    if (debugger.m_opaque_sp.get() != nullptr)
-        debugger.m_opaque_sp.reset();
-}
+  debugger.reset(Debugger::CreateInstance(callback, baton));
 
-void
-SBDebugger::MemoryPressureDetected ()
-{
-    // Since this function can be call asynchronously, we allow it to be
-    // non-mandatory. We have seen deadlocks with this function when called
-    // so we need to safeguard against this until we can determine what is
-    // causing the deadlocks.
-    Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    
-    const bool mandatory = false;
-    if (log)
-    {
-        log->Printf ("SBDebugger::MemoryPressureDetected (), mandatory = %d", mandatory);
-    }
-    
-    ModuleList::RemoveOrphanSharedModules(mandatory);
-}
+  if (log) {
+    SBStream sstr;
+    debugger.GetDescription(sstr);
+    log->Printf("SBDebugger::Create () => SBDebugger(%p): %s",
+                static_cast<void *>(debugger.m_opaque_sp.get()),
+                sstr.GetData());
+  }
 
-bool
-SBDebugger::IsValid() const
-{
-    return m_opaque_sp.get() != nullptr;
+  SBCommandInterpreter interp = debugger.GetCommandInterpreter();
+  if (source_init_files) {
+    interp.get()->SkipLLDBInitFiles(false);
+    interp.get()->SkipAppInitFiles(false);
+    SBCommandReturnObject result;
+    interp.SourceInitFileInHomeDirectory(result);
+  } else {
+    interp.get()->SkipLLDBInitFiles(true);
+    interp.get()->SkipAppInitFiles(true);
+  }
+  return debugger;
 }
 
-void
-SBDebugger::SetAsync (bool b)
-{
-    if (m_opaque_sp)
-        m_opaque_sp->SetAsyncExecution(b);
-}
+void SBDebugger::Destroy(SBDebugger &debugger) {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-bool
-SBDebugger::GetAsync()
-{
-    return (m_opaque_sp ? m_opaque_sp->GetAsyncExecution() : false);
-}
+  if (log) {
+    SBStream sstr;
+    debugger.GetDescription(sstr);
+    log->Printf("SBDebugger::Destroy () => SBDebugger(%p): %s",
+                static_cast<void *>(debugger.m_opaque_sp.get()),
+                sstr.GetData());
+  }
 
-void
-SBDebugger::SkipLLDBInitFiles (bool b)
-{
-    if (m_opaque_sp)
-        m_opaque_sp->GetCommandInterpreter().SkipLLDBInitFiles (b);
-}
+  Debugger::Destroy(debugger.m_opaque_sp);
 
-void
-SBDebugger::SkipAppInitFiles (bool b)
-{
-    if (m_opaque_sp)
-        m_opaque_sp->GetCommandInterpreter().SkipAppInitFiles (b);
+  if (debugger.m_opaque_sp.get() != nullptr)
+    debugger.m_opaque_sp.reset();
 }
 
-// Shouldn't really be settable after initialization as this could cause lots of problems; don't want users
-// trying to switch modes in the middle of a debugging session.
-void
-SBDebugger::SetInputFileHandle (FILE *fh, bool transfer_ownership)
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+void SBDebugger::MemoryPressureDetected() {
+  // Since this function can be call asynchronously, we allow it to be
+  // non-mandatory. We have seen deadlocks with this function when called
+  // so we need to safeguard against this until we can determine what is
+  // causing the deadlocks.
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-    if (log)
-        log->Printf ("SBDebugger(%p)::SetInputFileHandle (fh=%p, transfer_ownership=%i)",
-                     static_cast<void*>(m_opaque_sp.get()),
-                     static_cast<void*>(fh), transfer_ownership);
+  const bool mandatory = false;
+  if (log) {
+    log->Printf("SBDebugger::MemoryPressureDetected (), mandatory = %d",
+                mandatory);
+  }
 
-    if (m_opaque_sp)
-        m_opaque_sp->SetInputFileHandle (fh, transfer_ownership);
+  ModuleList::RemoveOrphanSharedModules(mandatory);
 }
 
-void
-SBDebugger::SetOutputFileHandle (FILE *fh, bool transfer_ownership)
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
+bool SBDebugger::IsValid() const { return m_opaque_sp.get() != nullptr; }
 
-    if (log)
-        log->Printf ("SBDebugger(%p)::SetOutputFileHandle (fh=%p, transfer_ownership=%i)",
-                     static_cast<void*>(m_opaque_sp.get()),
-                     static_cast<void*>(fh), transfer_ownership);
-
-    if (m_opaque_sp)
-        m_opaque_sp->SetOutputFileHandle (fh, transfer_ownership);
+void SBDebugger::SetAsync(bool b) {
+  if (m_opaque_sp)
+    m_opaque_sp->SetAsyncExecution(b);
 }
 
-void
-SBDebugger::SetErrorFileHandle (FILE *fh, bool transfer_ownership)
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-
-    if (log)
-        log->Printf ("SBDebugger(%p)::SetErrorFileHandle (fh=%p, transfer_ownership=%i)",
-                     static_cast<void*>(m_opaque_sp.get()),
-                     static_cast<void*>(fh), transfer_ownership);
-
-    if (m_opaque_sp)
-        m_opaque_sp->SetErrorFileHandle (fh, transfer_ownership);
+bool SBDebugger::GetAsync() {
+  return (m_opaque_sp ? m_opaque_sp->GetAsyncExecution() : false);
 }
 
-FILE *
-SBDebugger::GetInputFileHandle ()
-{
-    if (m_opaque_sp)
-    {
-        StreamFileSP stream_file_sp (m_opaque_sp->GetInputFile());
-        if (stream_file_sp)
-            return stream_file_sp->GetFile().GetStream();
-    }
-    return nullptr;
+void SBDebugger::SkipLLDBInitFiles(bool b) {
+  if (m_opaque_sp)
+    m_opaque_sp->GetCommandInterpreter().SkipLLDBInitFiles(b);
 }
 
-FILE *
-SBDebugger::GetOutputFileHandle ()
-{
-    if (m_opaque_sp)
-    {
-        StreamFileSP stream_file_sp (m_opaque_sp->GetOutputFile());
-        if (stream_file_sp)
-            return stream_file_sp->GetFile().GetStream();
-    }
-    return nullptr;
-}
-
-FILE *
-SBDebugger::GetErrorFileHandle ()
-{
-    if (m_opaque_sp)
-    {
-        StreamFileSP stream_file_sp(m_opaque_sp->GetErrorFile());
-        if (stream_file_sp)
-            return stream_file_sp->GetFile().GetStream();
-    }
-    return nullptr;
-}
-
-void
-SBDebugger::SaveInputTerminalState()
-{
-    if (m_opaque_sp)
-        m_opaque_sp->SaveInputTerminalState();
+void SBDebugger::SkipAppInitFiles(bool b) {
+  if (m_opaque_sp)
+    m_opaque_sp->GetCommandInterpreter().SkipAppInitFiles(b);
 }
 
-void
-SBDebugger::RestoreInputTerminalState()
-{
-    if (m_opaque_sp)
-        m_opaque_sp->RestoreInputTerminalState();
-
-}
-SBCommandInterpreter
-SBDebugger::GetCommandInterpreter ()
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    SBCommandInterpreter sb_interpreter;
-    if (m_opaque_sp)
-        sb_interpreter.reset (&m_opaque_sp->GetCommandInterpreter());
-
-    if (log)
-        log->Printf ("SBDebugger(%p)::GetCommandInterpreter () => SBCommandInterpreter(%p)",
-                     static_cast<void*>(m_opaque_sp.get()),
-                     static_cast<void*>(sb_interpreter.get()));
+// Shouldn't really be settable after initialization as this could cause lots of
+// problems; don't want users
+// trying to switch modes in the middle of a debugging session.
+void SBDebugger::SetInputFileHandle(FILE *fh, bool transfer_ownership) {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-    return sb_interpreter;
-}
+  if (log)
+    log->Printf(
+        "SBDebugger(%p)::SetInputFileHandle (fh=%p, transfer_ownership=%i)",
+        static_cast<void *>(m_opaque_sp.get()), static_cast<void *>(fh),
+        transfer_ownership);
 
-void
-SBDebugger::HandleCommand (const char *command)
-{
-    if (m_opaque_sp)
-    {
-        TargetSP target_sp (m_opaque_sp->GetSelectedTarget());
-        std::unique_lock<std::recursive_mutex> lock;
-        if (target_sp)
-            lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
-
-        SBCommandInterpreter sb_interpreter(GetCommandInterpreter ());
-        SBCommandReturnObject result;
-
-        sb_interpreter.HandleCommand (command, result, false);
-
-        if (GetErrorFileHandle() != nullptr)
-            result.PutError (GetErrorFileHandle());
-        if (GetOutputFileHandle() != nullptr)
-            result.PutOutput (GetOutputFileHandle());
-
-        if (!m_opaque_sp->GetAsyncExecution())
-        {
-            SBProcess process(GetCommandInterpreter().GetProcess ());
-            ProcessSP process_sp (process.GetSP());
-            if (process_sp)
-            {
-                EventSP event_sp;
-                ListenerSP lldb_listener_sp = m_opaque_sp->GetListener();
-                while (lldb_listener_sp->GetNextEventForBroadcaster (process_sp.get(), event_sp))
-                {
-                    SBEvent event(event_sp);
-                    HandleProcessEvent (process, event, GetOutputFileHandle(), GetErrorFileHandle());
-                }
-            }
-        }
-    }
+  if (m_opaque_sp)
+    m_opaque_sp->SetInputFileHandle(fh, transfer_ownership);
 }
 
-SBListener
-SBDebugger::GetListener ()
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    SBListener sb_listener;
-    if (m_opaque_sp)
-        sb_listener.reset(m_opaque_sp->GetListener());
+void SBDebugger::SetOutputFileHandle(FILE *fh, bool transfer_ownership) {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-    if (log)
-        log->Printf ("SBDebugger(%p)::GetListener () => SBListener(%p)",
-                     static_cast<void*>(m_opaque_sp.get()),
-                     static_cast<void*>(sb_listener.get()));
+  if (log)
+    log->Printf(
+        "SBDebugger(%p)::SetOutputFileHandle (fh=%p, transfer_ownership=%i)",
+        static_cast<void *>(m_opaque_sp.get()), static_cast<void *>(fh),
+        transfer_ownership);
 
-    return sb_listener;
+  if (m_opaque_sp)
+    m_opaque_sp->SetOutputFileHandle(fh, transfer_ownership);
 }
 
-void
-SBDebugger::HandleProcessEvent (const SBProcess &process, const SBEvent &event, FILE *out, FILE *err)
-{
-    if (!process.IsValid())
-        return;
-
-    TargetSP target_sp (process.GetTarget().GetSP());
-    if (!target_sp)
-        return;
-
-    const uint32_t event_type = event.GetType();
-    char stdio_buffer[1024];
-    size_t len;
-
-    std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
-
-    if (event_type & (Process::eBroadcastBitSTDOUT | Process::eBroadcastBitStateChanged))
-    {
-        // Drain stdout when we stop just in case we have any bytes
-        while ((len = process.GetSTDOUT (stdio_buffer, sizeof (stdio_buffer))) > 0)
-            if (out != nullptr)
-                ::fwrite (stdio_buffer, 1, len, out);
-    }
-    
-    if (event_type & (Process::eBroadcastBitSTDERR | Process::eBroadcastBitStateChanged))
-    {
-        // Drain stderr when we stop just in case we have any bytes
-        while ((len = process.GetSTDERR (stdio_buffer, sizeof (stdio_buffer))) > 0)
-            if (err != nullptr)
-                ::fwrite (stdio_buffer, 1, len, err);
-    }
+void SBDebugger::SetErrorFileHandle(FILE *fh, bool transfer_ownership) {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-    if (event_type & Process::eBroadcastBitStateChanged)
-    {
-        StateType event_state = SBProcess::GetStateFromEvent (event);
-        
-        if (event_state == eStateInvalid)
-            return;
-        
-        bool is_stopped = StateIsStoppedState (event_state);
-        if (!is_stopped)
-            process.ReportEventState (event, out);
-    }
-}
+  if (log)
+    log->Printf(
+        "SBDebugger(%p)::SetErrorFileHandle (fh=%p, transfer_ownership=%i)",
+        static_cast<void *>(m_opaque_sp.get()), static_cast<void *>(fh),
+        transfer_ownership);
 
-SBSourceManager
-SBDebugger::GetSourceManager ()
-{
-    SBSourceManager sb_source_manager (*this);
-    return sb_source_manager;
+  if (m_opaque_sp)
+    m_opaque_sp->SetErrorFileHandle(fh, transfer_ownership);
 }
 
-bool
-SBDebugger::GetDefaultArchitecture (char *arch_name, size_t arch_name_len)
-{
-    if (arch_name && arch_name_len)
-    {
-        ArchSpec default_arch = Target::GetDefaultArchitecture ();
-
-        if (default_arch.IsValid())
-        {
-            const std::string &triple_str = default_arch.GetTriple().str();
-            if (!triple_str.empty())
-                ::snprintf (arch_name, arch_name_len, "%s", triple_str.c_str());
-            else
-                ::snprintf (arch_name, arch_name_len, "%s", default_arch.GetArchitectureName());
-            return true;
-        }
-    }
-    if (arch_name && arch_name_len)
-        arch_name[0] = '\0';
-    return false;
+FILE *SBDebugger::GetInputFileHandle() {
+  if (m_opaque_sp) {
+    StreamFileSP stream_file_sp(m_opaque_sp->GetInputFile());
+    if (stream_file_sp)
+      return stream_file_sp->GetFile().GetStream();
+  }
+  return nullptr;
 }
 
-bool
-SBDebugger::SetDefaultArchitecture (const char *arch_name)
-{
-    if (arch_name)
-    {
-        ArchSpec arch (arch_name);
-        if (arch.IsValid())
-        {
-            Target::SetDefaultArchitecture (arch);
-            return true;
-        }
-    }
-    return false;
+FILE *SBDebugger::GetOutputFileHandle() {
+  if (m_opaque_sp) {
+    StreamFileSP stream_file_sp(m_opaque_sp->GetOutputFile());
+    if (stream_file_sp)
+      return stream_file_sp->GetFile().GetStream();
+  }
+  return nullptr;
 }
 
-ScriptLanguage
-SBDebugger::GetScriptingLanguage(const char *script_language_name)
-{
-    return Args::StringToScriptLanguage(script_language_name,
-                                        eScriptLanguageDefault,
-                                        nullptr);
+FILE *SBDebugger::GetErrorFileHandle() {
+  if (m_opaque_sp) {
+    StreamFileSP stream_file_sp(m_opaque_sp->GetErrorFile());
+    if (stream_file_sp)
+      return stream_file_sp->GetFile().GetStream();
+  }
+  return nullptr;
 }
 
-const char *
-SBDebugger::GetVersionString ()
-{
-    return lldb_private::GetVersion();
+void SBDebugger::SaveInputTerminalState() {
+  if (m_opaque_sp)
+    m_opaque_sp->SaveInputTerminalState();
 }
 
-const char *
-SBDebugger::StateAsCString (StateType state)
-{
-    return lldb_private::StateAsCString (state);
+void SBDebugger::RestoreInputTerminalState() {
+  if (m_opaque_sp)
+    m_opaque_sp->RestoreInputTerminalState();
 }
+SBCommandInterpreter SBDebugger::GetCommandInterpreter() {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-bool
-SBDebugger::StateIsRunningState (StateType state)
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+  SBCommandInterpreter sb_interpreter;
+  if (m_opaque_sp)
+    sb_interpreter.reset(&m_opaque_sp->GetCommandInterpreter());
 
-    const bool result = lldb_private::StateIsRunningState (state);
-    if (log)
-        log->Printf ("SBDebugger::StateIsRunningState (state=%s) => %i", 
-                     StateAsCString (state), result);
+  if (log)
+    log->Printf(
+        "SBDebugger(%p)::GetCommandInterpreter () => SBCommandInterpreter(%p)",
+        static_cast<void *>(m_opaque_sp.get()),
+        static_cast<void *>(sb_interpreter.get()));
 
-    return result;
+  return sb_interpreter;
 }
 
-bool
-SBDebugger::StateIsStoppedState (StateType state)
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    const bool result = lldb_private::StateIsStoppedState (state, false);
-    if (log)
-        log->Printf ("SBDebugger::StateIsStoppedState (state=%s) => %i", 
-                     StateAsCString (state), result);
-
-    return result;
-}
-
-lldb::SBTarget
-SBDebugger::CreateTarget (const char *filename,
-                          const char *target_triple,
-                          const char *platform_name,
-                          bool add_dependent_modules,
-                          lldb::SBError& sb_error)
-{
-    SBTarget sb_target;
-    TargetSP target_sp;
-    if (m_opaque_sp)
-    {
-        sb_error.Clear();
-        OptionGroupPlatform platform_options (false);
-        platform_options.SetPlatformName (platform_name);
-
-        sb_error.ref() = m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp, 
-                                                                    filename, 
-                                                                    target_triple, 
-                                                                    add_dependent_modules, 
-                                                                    &platform_options,
-                                                                    target_sp);
+void SBDebugger::HandleCommand(const char *command) {
+  if (m_opaque_sp) {
+    TargetSP target_sp(m_opaque_sp->GetSelectedTarget());
+    std::unique_lock<std::recursive_mutex> lock;
+    if (target_sp)
+      lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
 
-        if (sb_error.Success())
-            sb_target.SetSP (target_sp);
-    }
-    else
-    {
-        sb_error.SetErrorString("invalid debugger");
-    }
+    SBCommandInterpreter sb_interpreter(GetCommandInterpreter());
+    SBCommandReturnObject result;
 
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBDebugger(%p)::CreateTarget (filename=\"%s\", triple=%s, platform_name=%s, add_dependent_modules=%u, error=%s) => SBTarget(%p)",
-                     static_cast<void*>(m_opaque_sp.get()), filename,
-                     target_triple, platform_name, add_dependent_modules,
-                     sb_error.GetCString(), static_cast<void*>(target_sp.get()));
+    sb_interpreter.HandleCommand(command, result, false);
 
-    return sb_target;
-}
+    if (GetErrorFileHandle() != nullptr)
+      result.PutError(GetErrorFileHandle());
+    if (GetOutputFileHandle() != nullptr)
+      result.PutOutput(GetOutputFileHandle());
 
-SBTarget
-SBDebugger::CreateTargetWithFileAndTargetTriple (const char *filename,
-                                                 const char *target_triple)
-{
-    SBTarget sb_target;
-    TargetSP target_sp;
-    if (m_opaque_sp)
-    {
-        const bool add_dependent_modules = true;
-        Error error (m_opaque_sp->GetTargetList().CreateTarget(*m_opaque_sp,
-                                                               filename,
-                                                               target_triple,
-                                                               add_dependent_modules,
-                                                               nullptr,
-                                                               target_sp));
-        sb_target.SetSP (target_sp);
+    if (!m_opaque_sp->GetAsyncExecution()) {
+      SBProcess process(GetCommandInterpreter().GetProcess());
+      ProcessSP process_sp(process.GetSP());
+      if (process_sp) {
+        EventSP event_sp;
+        ListenerSP lldb_listener_sp = m_opaque_sp->GetListener();
+        while (lldb_listener_sp->GetNextEventForBroadcaster(process_sp.get(),
+                                                            event_sp)) {
+          SBEvent event(event_sp);
+          HandleProcessEvent(process, event, GetOutputFileHandle(),
+                             GetErrorFileHandle());
+        }
+      }
     }
-
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBDebugger(%p)::CreateTargetWithFileAndTargetTriple (filename=\"%s\", triple=%s) => SBTarget(%p)",
-                     static_cast<void*>(m_opaque_sp.get()), filename,
-                     target_triple, static_cast<void*>(target_sp.get()));
-
-    return sb_target;
+  }
 }
 
-SBTarget
-SBDebugger::CreateTargetWithFileAndArch (const char *filename, const char *arch_cstr)
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+SBListener SBDebugger::GetListener() {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-    SBTarget sb_target;
-    TargetSP target_sp;
-    if (m_opaque_sp)
-    {
-        Error error;
-        const bool add_dependent_modules = true;
-
-        error = m_opaque_sp->GetTargetList().CreateTarget(*m_opaque_sp,
-                                                          filename,
-                                                          arch_cstr,
-                                                          add_dependent_modules,
-                                                          nullptr,
-                                                          target_sp);
-
-        if (error.Success())
-        {
-            m_opaque_sp->GetTargetList().SetSelectedTarget (target_sp.get());
-            sb_target.SetSP (target_sp);
-        }
-    }
+  SBListener sb_listener;
+  if (m_opaque_sp)
+    sb_listener.reset(m_opaque_sp->GetListener());
 
-    if (log)
-        log->Printf ("SBDebugger(%p)::CreateTargetWithFileAndArch (filename=\"%s\", arch=%s) => SBTarget(%p)",
-                     static_cast<void*>(m_opaque_sp.get()), filename, arch_cstr,
-                     static_cast<void*>(target_sp.get()));
+  if (log)
+    log->Printf("SBDebugger(%p)::GetListener () => SBListener(%p)",
+                static_cast<void *>(m_opaque_sp.get()),
+                static_cast<void *>(sb_listener.get()));
 
-    return sb_target;
+  return sb_listener;
 }
 
-SBTarget
-SBDebugger::CreateTarget (const char *filename)
-{
-    SBTarget sb_target;
-    TargetSP target_sp;
-    if (m_opaque_sp)
-    {
-        Error error;
-        const bool add_dependent_modules = true;
-        error = m_opaque_sp->GetTargetList().CreateTarget(*m_opaque_sp,
-                                                          filename,
-                                                          nullptr,
-                                                          add_dependent_modules,
-                                                          nullptr,
-                                                          target_sp);
-
-        if (error.Success())
-        {
-            m_opaque_sp->GetTargetList().SetSelectedTarget (target_sp.get());
-            sb_target.SetSP (target_sp);
-        }
-    }
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBDebugger(%p)::CreateTarget (filename=\"%s\") => SBTarget(%p)",
-                     static_cast<void*>(m_opaque_sp.get()), filename,
-                     static_cast<void*>(target_sp.get()));
-    return sb_target;
-}
+void SBDebugger::HandleProcessEvent(const SBProcess &process,
+                                    const SBEvent &event, FILE *out,
+                                    FILE *err) {
+  if (!process.IsValid())
+    return;
 
-bool
-SBDebugger::DeleteTarget (lldb::SBTarget &target)
-{
-    bool result = false;
-    if (m_opaque_sp)
-    {
-        TargetSP target_sp(target.GetSP());
-        if (target_sp)
-        {
-            // No need to lock, the target list is thread safe
-            result = m_opaque_sp->GetTargetList().DeleteTarget (target_sp);
-            target_sp->Destroy();
-            target.Clear();
-            const bool mandatory = true;
-            ModuleList::RemoveOrphanSharedModules(mandatory);
-        }
-    }
+  TargetSP target_sp(process.GetTarget().GetSP());
+  if (!target_sp)
+    return;
 
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBDebugger(%p)::DeleteTarget (SBTarget(%p)) => %i",
-                     static_cast<void*>(m_opaque_sp.get()),
-                     static_cast<void*>(target.m_opaque_sp.get()), result);
+  const uint32_t event_type = event.GetType();
+  char stdio_buffer[1024];
+  size_t len;
 
-    return result;
-}
+  std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
 
-SBTarget
-SBDebugger::GetTargetAtIndex (uint32_t idx)
-{
-    SBTarget sb_target;
-    if (m_opaque_sp)
-    {
-        // No need to lock, the target list is thread safe
-        sb_target.SetSP (m_opaque_sp->GetTargetList().GetTargetAtIndex (idx));
-    }
-    return sb_target;
-}
+  if (event_type &
+      (Process::eBroadcastBitSTDOUT | Process::eBroadcastBitStateChanged)) {
+    // Drain stdout when we stop just in case we have any bytes
+    while ((len = process.GetSTDOUT(stdio_buffer, sizeof(stdio_buffer))) > 0)
+      if (out != nullptr)
+        ::fwrite(stdio_buffer, 1, len, out);
+  }
 
-uint32_t
-SBDebugger::GetIndexOfTarget (lldb::SBTarget target)
-{
+  if (event_type &
+      (Process::eBroadcastBitSTDERR | Process::eBroadcastBitStateChanged)) {
+    // Drain stderr when we stop just in case we have any bytes
+    while ((len = process.GetSTDERR(stdio_buffer, sizeof(stdio_buffer))) > 0)
+      if (err != nullptr)
+        ::fwrite(stdio_buffer, 1, len, err);
+  }
 
-    lldb::TargetSP target_sp = target.GetSP();
-    if (!target_sp)
-        return UINT32_MAX;
+  if (event_type & Process::eBroadcastBitStateChanged) {
+    StateType event_state = SBProcess::GetStateFromEvent(event);
 
-    if (!m_opaque_sp)
-        return UINT32_MAX;
+    if (event_state == eStateInvalid)
+      return;
 
-    return m_opaque_sp->GetTargetList().GetIndexOfTarget (target.GetSP());
+    bool is_stopped = StateIsStoppedState(event_state);
+    if (!is_stopped)
+      process.ReportEventState(event, out);
+  }
 }
 
-SBTarget
-SBDebugger::FindTargetWithProcessID (lldb::pid_t pid)
-{
-    SBTarget sb_target;
-    if (m_opaque_sp)
-    {
-        // No need to lock, the target list is thread safe
-        sb_target.SetSP (m_opaque_sp->GetTargetList().FindTargetWithProcessID (pid));
-    }
-    return sb_target;
+SBSourceManager SBDebugger::GetSourceManager() {
+  SBSourceManager sb_source_manager(*this);
+  return sb_source_manager;
 }
 
-SBTarget
-SBDebugger::FindTargetWithFileAndArch (const char *filename, const char *arch_name)
-{
-    SBTarget sb_target;
-    if (m_opaque_sp && filename && filename[0])
-    {
-        // No need to lock, the target list is thread safe
-        ArchSpec arch (arch_name, m_opaque_sp->GetPlatformList().GetSelectedPlatform().get());
-        TargetSP target_sp (m_opaque_sp->GetTargetList().FindTargetWithExecutableAndArchitecture(FileSpec(filename, false), arch_name ? &arch : nullptr));
-        sb_target.SetSP (target_sp);
-    }
-    return sb_target;
-}
+bool SBDebugger::GetDefaultArchitecture(char *arch_name, size_t arch_name_len) {
+  if (arch_name && arch_name_len) {
+    ArchSpec default_arch = Target::GetDefaultArchitecture();
 
-SBTarget
-SBDebugger::FindTargetWithLLDBProcess (const ProcessSP &process_sp)
-{
-    SBTarget sb_target;
-    if (m_opaque_sp)
-    {
-        // No need to lock, the target list is thread safe
-        sb_target.SetSP (m_opaque_sp->GetTargetList().FindTargetWithProcess (process_sp.get()));
+    if (default_arch.IsValid()) {
+      const std::string &triple_str = default_arch.GetTriple().str();
+      if (!triple_str.empty())
+        ::snprintf(arch_name, arch_name_len, "%s", triple_str.c_str());
+      else
+        ::snprintf(arch_name, arch_name_len, "%s",
+                   default_arch.GetArchitectureName());
+      return true;
     }
-    return sb_target;
+  }
+  if (arch_name && arch_name_len)
+    arch_name[0] = '\0';
+  return false;
 }
 
-uint32_t
-SBDebugger::GetNumTargets ()
-{
-    if (m_opaque_sp)
-    {
-        // No need to lock, the target list is thread safe
-        return m_opaque_sp->GetTargetList().GetNumTargets ();
+bool SBDebugger::SetDefaultArchitecture(const char *arch_name) {
+  if (arch_name) {
+    ArchSpec arch(arch_name);
+    if (arch.IsValid()) {
+      Target::SetDefaultArchitecture(arch);
+      return true;
     }
-    return 0;
+  }
+  return false;
 }
 
-SBTarget
-SBDebugger::GetSelectedTarget ()
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    SBTarget sb_target;
-    TargetSP target_sp;
-    if (m_opaque_sp)
-    {
-        // No need to lock, the target list is thread safe
-        target_sp = m_opaque_sp->GetTargetList().GetSelectedTarget ();
-        sb_target.SetSP (target_sp);
-    }
-
-    if (log)
-    {
-        SBStream sstr;
-        sb_target.GetDescription (sstr, eDescriptionLevelBrief);
-        log->Printf ("SBDebugger(%p)::GetSelectedTarget () => SBTarget(%p): %s",
-                     static_cast<void*>(m_opaque_sp.get()),
-                     static_cast<void*>(target_sp.get()), sstr.GetData());
-    }
-
-    return sb_target;
+ScriptLanguage
+SBDebugger::GetScriptingLanguage(const char *script_language_name) {
+  return Args::StringToScriptLanguage(script_language_name,
+                                      eScriptLanguageDefault, nullptr);
 }
 
-void
-SBDebugger::SetSelectedTarget (SBTarget &sb_target)
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    TargetSP target_sp (sb_target.GetSP());
-    if (m_opaque_sp)
-    {
-        m_opaque_sp->GetTargetList().SetSelectedTarget (target_sp.get());
-    }
-    if (log)
-    {
-        SBStream sstr;
-        sb_target.GetDescription (sstr, eDescriptionLevelBrief);
-        log->Printf ("SBDebugger(%p)::SetSelectedTarget () => SBTarget(%p): %s",
-                     static_cast<void*>(m_opaque_sp.get()),
-                     static_cast<void*>(target_sp.get()), sstr.GetData());
-    }
+const char *SBDebugger::GetVersionString() {
+  return lldb_private::GetVersion();
 }
 
-SBPlatform
-SBDebugger::GetSelectedPlatform()
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    SBPlatform sb_platform;
-    DebuggerSP debugger_sp(m_opaque_sp);
-    if (debugger_sp)
-    {
-        sb_platform.SetSP(debugger_sp->GetPlatformList().GetSelectedPlatform());
-    }
-    if (log)
-        log->Printf ("SBDebugger(%p)::GetSelectedPlatform () => SBPlatform(%p): %s",
-                     static_cast<void*>(m_opaque_sp.get()),
-                     static_cast<void*>(sb_platform.GetSP().get()),
-                     sb_platform.GetName());
-    return sb_platform;
+const char *SBDebugger::StateAsCString(StateType state) {
+  return lldb_private::StateAsCString(state);
 }
 
-void
-SBDebugger::SetSelectedPlatform(SBPlatform &sb_platform)
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    DebuggerSP debugger_sp(m_opaque_sp);
-    if (debugger_sp)
-    {
-        debugger_sp->GetPlatformList().SetSelectedPlatform(sb_platform.GetSP());
-    }
-
-    if (log)
-        log->Printf ("SBDebugger(%p)::SetSelectedPlatform (SBPlatform(%p) %s)",
-                     static_cast<void*>(m_opaque_sp.get()),
-                     static_cast<void*>(sb_platform.GetSP().get()),
-                     sb_platform.GetName());
-}
+bool SBDebugger::StateIsRunningState(StateType state) {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-void
-SBDebugger::DispatchInput (void* baton, const void *data, size_t data_len)
-{
-    DispatchInput (data,data_len);
-}
+  const bool result = lldb_private::StateIsRunningState(state);
+  if (log)
+    log->Printf("SBDebugger::StateIsRunningState (state=%s) => %i",
+                StateAsCString(state), result);
 
-void
-SBDebugger::DispatchInput (const void *data, size_t data_len)
-{
-//    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-//
-//    if (log)
-//        log->Printf ("SBDebugger(%p)::DispatchInput (data=\"%.*s\", size_t=%" PRIu64 ")",
-//                     m_opaque_sp.get(),
-//                     (int) data_len,
-//                     (const char *) data,
-//                     (uint64_t)data_len);
-//
-//    if (m_opaque_sp)
-//        m_opaque_sp->DispatchInput ((const char *) data, data_len);
+  return result;
 }
 
-void
-SBDebugger::DispatchInputInterrupt ()
-{
-    if (m_opaque_sp)
-        m_opaque_sp->DispatchInputInterrupt ();
-}
+bool SBDebugger::StateIsStoppedState(StateType state) {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-void
-SBDebugger::DispatchInputEndOfFile ()
-{
-    if (m_opaque_sp)
-        m_opaque_sp->DispatchInputEndOfFile ();
-}
+  const bool result = lldb_private::StateIsStoppedState(state, false);
+  if (log)
+    log->Printf("SBDebugger::StateIsStoppedState (state=%s) => %i",
+                StateAsCString(state), result);
 
-void
-SBDebugger::PushInputReader (SBInputReader &reader)
-{
+  return result;
 }
 
-void
-SBDebugger::RunCommandInterpreter (bool auto_handle_events,
-                                   bool spawn_thread)
-{
-    if (m_opaque_sp)
-    {
-        CommandInterpreterRunOptions options;
-
-        m_opaque_sp->GetCommandInterpreter().RunCommandInterpreter(auto_handle_events,
-                                                                   spawn_thread,
-                                                                   options);
-    }
-}
+lldb::SBTarget SBDebugger::CreateTarget(const char *filename,
+                                        const char *target_triple,
+                                        const char *platform_name,
+                                        bool add_dependent_modules,
+                                        lldb::SBError &sb_error) {
+  SBTarget sb_target;
+  TargetSP target_sp;
+  if (m_opaque_sp) {
+    sb_error.Clear();
+    OptionGroupPlatform platform_options(false);
+    platform_options.SetPlatformName(platform_name);
 
-void
-SBDebugger::RunCommandInterpreter (bool auto_handle_events,
-                                   bool spawn_thread,
-                                   SBCommandInterpreterRunOptions &options,
-                                   int  &num_errors,
-                                   bool &quit_requested,
-                                   bool &stopped_for_crash)
+    sb_error.ref() = m_opaque_sp->GetTargetList().CreateTarget(
+        *m_opaque_sp, filename, target_triple, add_dependent_modules,
+        &platform_options, target_sp);
 
-{
-    if (m_opaque_sp)
-    {
-        CommandInterpreter &interp = m_opaque_sp->GetCommandInterpreter();
-        interp.RunCommandInterpreter(auto_handle_events, spawn_thread, options.ref());
-        num_errors = interp.GetNumErrors();
-        quit_requested = interp.GetQuitRequested();
-        stopped_for_crash = interp.GetStoppedForCrash();
-    }
-}
+    if (sb_error.Success())
+      sb_target.SetSP(target_sp);
+  } else {
+    sb_error.SetErrorString("invalid debugger");
+  }
 
-SBError
-SBDebugger::RunREPL (lldb::LanguageType language, const char *repl_options)
-{
-    SBError error;
-    if (m_opaque_sp)
-        error.ref() = m_opaque_sp->RunREPL(language, repl_options);
-    else
-        error.SetErrorString ("invalid debugger");
-    return error;
-}
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBDebugger(%p)::CreateTarget (filename=\"%s\", triple=%s, "
+                "platform_name=%s, add_dependent_modules=%u, error=%s) => "
+                "SBTarget(%p)",
+                static_cast<void *>(m_opaque_sp.get()), filename, target_triple,
+                platform_name, add_dependent_modules, sb_error.GetCString(),
+                static_cast<void *>(target_sp.get()));
 
-void
-SBDebugger::reset (const DebuggerSP &debugger_sp)
-{
-    m_opaque_sp = debugger_sp;
+  return sb_target;
 }
 
-Debugger *
-SBDebugger::get () const
-{
-    return m_opaque_sp.get();
-}
+SBTarget
+SBDebugger::CreateTargetWithFileAndTargetTriple(const char *filename,
+                                                const char *target_triple) {
+  SBTarget sb_target;
+  TargetSP target_sp;
+  if (m_opaque_sp) {
+    const bool add_dependent_modules = true;
+    Error error(m_opaque_sp->GetTargetList().CreateTarget(
+        *m_opaque_sp, filename, target_triple, add_dependent_modules, nullptr,
+        target_sp));
+    sb_target.SetSP(target_sp);
+  }
+
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBDebugger(%p)::CreateTargetWithFileAndTargetTriple "
+                "(filename=\"%s\", triple=%s) => SBTarget(%p)",
+                static_cast<void *>(m_opaque_sp.get()), filename, target_triple,
+                static_cast<void *>(target_sp.get()));
+
+  return sb_target;
+}
+
+SBTarget SBDebugger::CreateTargetWithFileAndArch(const char *filename,
+                                                 const char *arch_cstr) {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  SBTarget sb_target;
+  TargetSP target_sp;
+  if (m_opaque_sp) {
+    Error error;
+    const bool add_dependent_modules = true;
 
-Debugger &
-SBDebugger::ref () const
-{
-    assert (m_opaque_sp.get());
-    return *m_opaque_sp;
-}
+    error = m_opaque_sp->GetTargetList().CreateTarget(
+        *m_opaque_sp, filename, arch_cstr, add_dependent_modules, nullptr,
+        target_sp);
 
-const lldb::DebuggerSP &
-SBDebugger::get_sp () const
-{
-    return m_opaque_sp;
-}
+    if (error.Success()) {
+      m_opaque_sp->GetTargetList().SetSelectedTarget(target_sp.get());
+      sb_target.SetSP(target_sp);
+    }
+  }
 
-SBDebugger
-SBDebugger::FindDebuggerWithID (int id)
-{
-    // No need to lock, the debugger list is thread safe
-    SBDebugger sb_debugger;
-    DebuggerSP debugger_sp = Debugger::FindDebuggerWithID (id);
-    if (debugger_sp)
-        sb_debugger.reset (debugger_sp);
-    return sb_debugger;
-}
+  if (log)
+    log->Printf("SBDebugger(%p)::CreateTargetWithFileAndArch (filename=\"%s\", "
+                "arch=%s) => SBTarget(%p)",
+                static_cast<void *>(m_opaque_sp.get()), filename, arch_cstr,
+                static_cast<void *>(target_sp.get()));
 
-const char *
-SBDebugger::GetInstanceName()
-{
-    return (m_opaque_sp ? m_opaque_sp->GetInstanceName().AsCString() : nullptr);
+  return sb_target;
 }
 
-SBError
-SBDebugger::SetInternalVariable (const char *var_name, const char *value, const char *debugger_instance_name)
-{
-    SBError sb_error;
-    DebuggerSP debugger_sp(Debugger::FindDebuggerWithInstanceName (ConstString(debugger_instance_name)));
+SBTarget SBDebugger::CreateTarget(const char *filename) {
+  SBTarget sb_target;
+  TargetSP target_sp;
+  if (m_opaque_sp) {
     Error error;
-    if (debugger_sp)
-    {
-        ExecutionContext exe_ctx (debugger_sp->GetCommandInterpreter().GetExecutionContext());
-        error = debugger_sp->SetPropertyValue (&exe_ctx,
-                                               eVarSetOperationAssign,
-                                               var_name,
-                                               value);
-    }
-    else
-    {
-        error.SetErrorStringWithFormat ("invalid debugger instance name '%s'", debugger_instance_name);
-    }
-    if (error.Fail())
-        sb_error.SetError(error);
-    return sb_error;
+    const bool add_dependent_modules = true;
+    error = m_opaque_sp->GetTargetList().CreateTarget(
+        *m_opaque_sp, filename, nullptr, add_dependent_modules, nullptr,
+        target_sp);
+
+    if (error.Success()) {
+      m_opaque_sp->GetTargetList().SetSelectedTarget(target_sp.get());
+      sb_target.SetSP(target_sp);
+    }
+  }
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf(
+        "SBDebugger(%p)::CreateTarget (filename=\"%s\") => SBTarget(%p)",
+        static_cast<void *>(m_opaque_sp.get()), filename,
+        static_cast<void *>(target_sp.get()));
+  return sb_target;
+}
+
+bool SBDebugger::DeleteTarget(lldb::SBTarget &target) {
+  bool result = false;
+  if (m_opaque_sp) {
+    TargetSP target_sp(target.GetSP());
+    if (target_sp) {
+      // No need to lock, the target list is thread safe
+      result = m_opaque_sp->GetTargetList().DeleteTarget(target_sp);
+      target_sp->Destroy();
+      target.Clear();
+      const bool mandatory = true;
+      ModuleList::RemoveOrphanSharedModules(mandatory);
+    }
+  }
+
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBDebugger(%p)::DeleteTarget (SBTarget(%p)) => %i",
+                static_cast<void *>(m_opaque_sp.get()),
+                static_cast<void *>(target.m_opaque_sp.get()), result);
+
+  return result;
+}
+
+SBTarget SBDebugger::GetTargetAtIndex(uint32_t idx) {
+  SBTarget sb_target;
+  if (m_opaque_sp) {
+    // No need to lock, the target list is thread safe
+    sb_target.SetSP(m_opaque_sp->GetTargetList().GetTargetAtIndex(idx));
+  }
+  return sb_target;
+}
+
+uint32_t SBDebugger::GetIndexOfTarget(lldb::SBTarget target) {
+
+  lldb::TargetSP target_sp = target.GetSP();
+  if (!target_sp)
+    return UINT32_MAX;
+
+  if (!m_opaque_sp)
+    return UINT32_MAX;
+
+  return m_opaque_sp->GetTargetList().GetIndexOfTarget(target.GetSP());
+}
+
+SBTarget SBDebugger::FindTargetWithProcessID(lldb::pid_t pid) {
+  SBTarget sb_target;
+  if (m_opaque_sp) {
+    // No need to lock, the target list is thread safe
+    sb_target.SetSP(m_opaque_sp->GetTargetList().FindTargetWithProcessID(pid));
+  }
+  return sb_target;
+}
+
+SBTarget SBDebugger::FindTargetWithFileAndArch(const char *filename,
+                                               const char *arch_name) {
+  SBTarget sb_target;
+  if (m_opaque_sp && filename && filename[0]) {
+    // No need to lock, the target list is thread safe
+    ArchSpec arch(arch_name,
+                  m_opaque_sp->GetPlatformList().GetSelectedPlatform().get());
+    TargetSP target_sp(
+        m_opaque_sp->GetTargetList().FindTargetWithExecutableAndArchitecture(
+            FileSpec(filename, false), arch_name ? &arch : nullptr));
+    sb_target.SetSP(target_sp);
+  }
+  return sb_target;
+}
+
+SBTarget SBDebugger::FindTargetWithLLDBProcess(const ProcessSP &process_sp) {
+  SBTarget sb_target;
+  if (m_opaque_sp) {
+    // No need to lock, the target list is thread safe
+    sb_target.SetSP(
+        m_opaque_sp->GetTargetList().FindTargetWithProcess(process_sp.get()));
+  }
+  return sb_target;
+}
+
+uint32_t SBDebugger::GetNumTargets() {
+  if (m_opaque_sp) {
+    // No need to lock, the target list is thread safe
+    return m_opaque_sp->GetTargetList().GetNumTargets();
+  }
+  return 0;
+}
+
+SBTarget SBDebugger::GetSelectedTarget() {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  SBTarget sb_target;
+  TargetSP target_sp;
+  if (m_opaque_sp) {
+    // No need to lock, the target list is thread safe
+    target_sp = m_opaque_sp->GetTargetList().GetSelectedTarget();
+    sb_target.SetSP(target_sp);
+  }
+
+  if (log) {
+    SBStream sstr;
+    sb_target.GetDescription(sstr, eDescriptionLevelBrief);
+    log->Printf("SBDebugger(%p)::GetSelectedTarget () => SBTarget(%p): %s",
+                static_cast<void *>(m_opaque_sp.get()),
+                static_cast<void *>(target_sp.get()), sstr.GetData());
+  }
+
+  return sb_target;
+}
+
+void SBDebugger::SetSelectedTarget(SBTarget &sb_target) {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  TargetSP target_sp(sb_target.GetSP());
+  if (m_opaque_sp) {
+    m_opaque_sp->GetTargetList().SetSelectedTarget(target_sp.get());
+  }
+  if (log) {
+    SBStream sstr;
+    sb_target.GetDescription(sstr, eDescriptionLevelBrief);
+    log->Printf("SBDebugger(%p)::SetSelectedTarget () => SBTarget(%p): %s",
+                static_cast<void *>(m_opaque_sp.get()),
+                static_cast<void *>(target_sp.get()), sstr.GetData());
+  }
+}
+
+SBPlatform SBDebugger::GetSelectedPlatform() {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  SBPlatform sb_platform;
+  DebuggerSP debugger_sp(m_opaque_sp);
+  if (debugger_sp) {
+    sb_platform.SetSP(debugger_sp->GetPlatformList().GetSelectedPlatform());
+  }
+  if (log)
+    log->Printf("SBDebugger(%p)::GetSelectedPlatform () => SBPlatform(%p): %s",
+                static_cast<void *>(m_opaque_sp.get()),
+                static_cast<void *>(sb_platform.GetSP().get()),
+                sb_platform.GetName());
+  return sb_platform;
+}
+
+void SBDebugger::SetSelectedPlatform(SBPlatform &sb_platform) {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  DebuggerSP debugger_sp(m_opaque_sp);
+  if (debugger_sp) {
+    debugger_sp->GetPlatformList().SetSelectedPlatform(sb_platform.GetSP());
+  }
+
+  if (log)
+    log->Printf("SBDebugger(%p)::SetSelectedPlatform (SBPlatform(%p) %s)",
+                static_cast<void *>(m_opaque_sp.get()),
+                static_cast<void *>(sb_platform.GetSP().get()),
+                sb_platform.GetName());
+}
+
+void SBDebugger::DispatchInput(void *baton, const void *data, size_t data_len) {
+  DispatchInput(data, data_len);
+}
+
+void SBDebugger::DispatchInput(const void *data, size_t data_len) {
+  //    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+  //
+  //    if (log)
+  //        log->Printf ("SBDebugger(%p)::DispatchInput (data=\"%.*s\",
+  //        size_t=%" PRIu64 ")",
+  //                     m_opaque_sp.get(),
+  //                     (int) data_len,
+  //                     (const char *) data,
+  //                     (uint64_t)data_len);
+  //
+  //    if (m_opaque_sp)
+  //        m_opaque_sp->DispatchInput ((const char *) data, data_len);
+}
+
+void SBDebugger::DispatchInputInterrupt() {
+  if (m_opaque_sp)
+    m_opaque_sp->DispatchInputInterrupt();
+}
+
+void SBDebugger::DispatchInputEndOfFile() {
+  if (m_opaque_sp)
+    m_opaque_sp->DispatchInputEndOfFile();
+}
+
+void SBDebugger::PushInputReader(SBInputReader &reader) {}
+
+void SBDebugger::RunCommandInterpreter(bool auto_handle_events,
+                                       bool spawn_thread) {
+  if (m_opaque_sp) {
+    CommandInterpreterRunOptions options;
+
+    m_opaque_sp->GetCommandInterpreter().RunCommandInterpreter(
+        auto_handle_events, spawn_thread, options);
+  }
+}
+
+void SBDebugger::RunCommandInterpreter(bool auto_handle_events,
+                                       bool spawn_thread,
+                                       SBCommandInterpreterRunOptions &options,
+                                       int &num_errors, bool &quit_requested,
+                                       bool &stopped_for_crash)
+
+{
+  if (m_opaque_sp) {
+    CommandInterpreter &interp = m_opaque_sp->GetCommandInterpreter();
+    interp.RunCommandInterpreter(auto_handle_events, spawn_thread,
+                                 options.ref());
+    num_errors = interp.GetNumErrors();
+    quit_requested = interp.GetQuitRequested();
+    stopped_for_crash = interp.GetStoppedForCrash();
+  }
+}
+
+SBError SBDebugger::RunREPL(lldb::LanguageType language,
+                            const char *repl_options) {
+  SBError error;
+  if (m_opaque_sp)
+    error.ref() = m_opaque_sp->RunREPL(language, repl_options);
+  else
+    error.SetErrorString("invalid debugger");
+  return error;
+}
+
+void SBDebugger::reset(const DebuggerSP &debugger_sp) {
+  m_opaque_sp = debugger_sp;
+}
+
+Debugger *SBDebugger::get() const { return m_opaque_sp.get(); }
+
+Debugger &SBDebugger::ref() const {
+  assert(m_opaque_sp.get());
+  return *m_opaque_sp;
+}
+
+const lldb::DebuggerSP &SBDebugger::get_sp() const { return m_opaque_sp; }
+
+SBDebugger SBDebugger::FindDebuggerWithID(int id) {
+  // No need to lock, the debugger list is thread safe
+  SBDebugger sb_debugger;
+  DebuggerSP debugger_sp = Debugger::FindDebuggerWithID(id);
+  if (debugger_sp)
+    sb_debugger.reset(debugger_sp);
+  return sb_debugger;
+}
+
+const char *SBDebugger::GetInstanceName() {
+  return (m_opaque_sp ? m_opaque_sp->GetInstanceName().AsCString() : nullptr);
+}
+
+SBError SBDebugger::SetInternalVariable(const char *var_name, const char *value,
+                                        const char *debugger_instance_name) {
+  SBError sb_error;
+  DebuggerSP debugger_sp(Debugger::FindDebuggerWithInstanceName(
+      ConstString(debugger_instance_name)));
+  Error error;
+  if (debugger_sp) {
+    ExecutionContext exe_ctx(
+        debugger_sp->GetCommandInterpreter().GetExecutionContext());
+    error = debugger_sp->SetPropertyValue(&exe_ctx, eVarSetOperationAssign,
+                                          var_name, value);
+  } else {
+    error.SetErrorStringWithFormat("invalid debugger instance name '%s'",
+                                   debugger_instance_name);
+  }
+  if (error.Fail())
+    sb_error.SetError(error);
+  return sb_error;
 }
 
 SBStringList
-SBDebugger::GetInternalVariableValue (const char *var_name, const char *debugger_instance_name)
-{
-    SBStringList ret_value;
-    DebuggerSP debugger_sp(Debugger::FindDebuggerWithInstanceName (ConstString(debugger_instance_name)));
-    Error error;
-    if (debugger_sp)
-    {
-        ExecutionContext exe_ctx (debugger_sp->GetCommandInterpreter().GetExecutionContext());
-        lldb::OptionValueSP value_sp (debugger_sp->GetPropertyValue (&exe_ctx,
-                                                                     var_name,
-                                                                     false,
-                                                                     error));
-        if (value_sp)
-        {
-            StreamString value_strm;
-            value_sp->DumpValue (&exe_ctx, value_strm, OptionValue::eDumpOptionValue);
-            const std::string &value_str = value_strm.GetString();
-            if (!value_str.empty())
-            {
-                StringList string_list;
-                string_list.SplitIntoLines(value_str);
-                return SBStringList(&string_list);
-            }
-        }
+SBDebugger::GetInternalVariableValue(const char *var_name,
+                                     const char *debugger_instance_name) {
+  SBStringList ret_value;
+  DebuggerSP debugger_sp(Debugger::FindDebuggerWithInstanceName(
+      ConstString(debugger_instance_name)));
+  Error error;
+  if (debugger_sp) {
+    ExecutionContext exe_ctx(
+        debugger_sp->GetCommandInterpreter().GetExecutionContext());
+    lldb::OptionValueSP value_sp(
+        debugger_sp->GetPropertyValue(&exe_ctx, var_name, false, error));
+    if (value_sp) {
+      StreamString value_strm;
+      value_sp->DumpValue(&exe_ctx, value_strm, OptionValue::eDumpOptionValue);
+      const std::string &value_str = value_strm.GetString();
+      if (!value_str.empty()) {
+        StringList string_list;
+        string_list.SplitIntoLines(value_str);
+        return SBStringList(&string_list);
+      }
     }
-    return SBStringList();
+  }
+  return SBStringList();
 }
 
-uint32_t
-SBDebugger::GetTerminalWidth() const
-{
-    return (m_opaque_sp ? m_opaque_sp->GetTerminalWidth() : 0);
+uint32_t SBDebugger::GetTerminalWidth() const {
+  return (m_opaque_sp ? m_opaque_sp->GetTerminalWidth() : 0);
 }
 
-void
-SBDebugger::SetTerminalWidth (uint32_t term_width)
-{
-    if (m_opaque_sp)
-        m_opaque_sp->SetTerminalWidth (term_width);
+void SBDebugger::SetTerminalWidth(uint32_t term_width) {
+  if (m_opaque_sp)
+    m_opaque_sp->SetTerminalWidth(term_width);
 }
 
-const char *
-SBDebugger::GetPrompt() const
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+const char *SBDebugger::GetPrompt() const {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-    if (log)
-        log->Printf ("SBDebugger(%p)::GetPrompt () => \"%s\"",
-                     static_cast<void*>(m_opaque_sp.get()),
-                     (m_opaque_sp ? m_opaque_sp->GetPrompt() : ""));
+  if (log)
+    log->Printf("SBDebugger(%p)::GetPrompt () => \"%s\"",
+                static_cast<void *>(m_opaque_sp.get()),
+                (m_opaque_sp ? m_opaque_sp->GetPrompt() : ""));
 
-    return (m_opaque_sp ? m_opaque_sp->GetPrompt() : nullptr);
+  return (m_opaque_sp ? m_opaque_sp->GetPrompt() : nullptr);
 }
 
-void
-SBDebugger::SetPrompt (const char *prompt)
-{
-    if (m_opaque_sp)
-        m_opaque_sp->SetPrompt (prompt);
+void SBDebugger::SetPrompt(const char *prompt) {
+  if (m_opaque_sp)
+    m_opaque_sp->SetPrompt(prompt);
 }
-    
-ScriptLanguage 
-SBDebugger::GetScriptLanguage() const
-{
-    return (m_opaque_sp ? m_opaque_sp->GetScriptLanguage() : eScriptLanguageNone);
+
+ScriptLanguage SBDebugger::GetScriptLanguage() const {
+  return (m_opaque_sp ? m_opaque_sp->GetScriptLanguage() : eScriptLanguageNone);
 }
 
-void
-SBDebugger::SetScriptLanguage (ScriptLanguage script_lang)
-{
-    if (m_opaque_sp)
-    {
-        m_opaque_sp->SetScriptLanguage (script_lang);
-    }
+void SBDebugger::SetScriptLanguage(ScriptLanguage script_lang) {
+  if (m_opaque_sp) {
+    m_opaque_sp->SetScriptLanguage(script_lang);
+  }
 }
 
-bool
-SBDebugger::SetUseExternalEditor(bool value)
-{
-    return (m_opaque_sp ? m_opaque_sp->SetUseExternalEditor(value) : false);
+bool SBDebugger::SetUseExternalEditor(bool value) {
+  return (m_opaque_sp ? m_opaque_sp->SetUseExternalEditor(value) : false);
 }
 
-bool
-SBDebugger::GetUseExternalEditor()
-{
-    return (m_opaque_sp ? m_opaque_sp->GetUseExternalEditor() : false);
+bool SBDebugger::GetUseExternalEditor() {
+  return (m_opaque_sp ? m_opaque_sp->GetUseExternalEditor() : false);
 }
 
-bool
-SBDebugger::SetUseColor(bool value)
-{
-    return (m_opaque_sp ? m_opaque_sp->SetUseColor(value) : false);
+bool SBDebugger::SetUseColor(bool value) {
+  return (m_opaque_sp ? m_opaque_sp->SetUseColor(value) : false);
 }
 
-bool
-SBDebugger::GetUseColor() const
-{
-    return (m_opaque_sp ? m_opaque_sp->GetUseColor() : false);
+bool SBDebugger::GetUseColor() const {
+  return (m_opaque_sp ? m_opaque_sp->GetUseColor() : false);
 }
 
-bool
-SBDebugger::GetDescription (SBStream &description)
-{
-    Stream &strm = description.ref();
+bool SBDebugger::GetDescription(SBStream &description) {
+  Stream &strm = description.ref();
 
-    if (m_opaque_sp)
-    {
-        const char *name = m_opaque_sp->GetInstanceName().AsCString();
-        user_id_t id = m_opaque_sp->GetID();
-        strm.Printf ("Debugger (instance: \"%s\", id: %" PRIu64 ")", name, id);
-    }
-    else
-        strm.PutCString ("No value");
-    
-    return true;
+  if (m_opaque_sp) {
+    const char *name = m_opaque_sp->GetInstanceName().AsCString();
+    user_id_t id = m_opaque_sp->GetID();
+    strm.Printf("Debugger (instance: \"%s\", id: %" PRIu64 ")", name, id);
+  } else
+    strm.PutCString("No value");
+
+  return true;
 }
 
-user_id_t
-SBDebugger::GetID()
-{
-    return (m_opaque_sp ? m_opaque_sp->GetID() : LLDB_INVALID_UID);
+user_id_t SBDebugger::GetID() {
+  return (m_opaque_sp ? m_opaque_sp->GetID() : LLDB_INVALID_UID);
 }
 
-SBError
-SBDebugger::SetCurrentPlatform (const char *platform_name_cstr)
-{
-    SBError sb_error;
-    if (m_opaque_sp)
-    {
-        if (platform_name_cstr && platform_name_cstr[0])
-        {
-            ConstString platform_name (platform_name_cstr);
-            PlatformSP platform_sp (Platform::Find (platform_name));
-
-            if (platform_sp)
-            {
-                // Already have a platform with this name, just select it
-                m_opaque_sp->GetPlatformList().SetSelectedPlatform(platform_sp);
-            }
-            else
-            {
-                // We don't have a platform by this name yet, create one
-                platform_sp = Platform::Create (platform_name, sb_error.ref());
-                if (platform_sp)
-                {
-                    // We created the platform, now append and select it
-                    bool make_selected = true;
-                    m_opaque_sp->GetPlatformList().Append (platform_sp, make_selected);
-                }
-            }
-        }
-        else
-        {
-            sb_error.ref().SetErrorString("invalid platform name");
+SBError SBDebugger::SetCurrentPlatform(const char *platform_name_cstr) {
+  SBError sb_error;
+  if (m_opaque_sp) {
+    if (platform_name_cstr && platform_name_cstr[0]) {
+      ConstString platform_name(platform_name_cstr);
+      PlatformSP platform_sp(Platform::Find(platform_name));
+
+      if (platform_sp) {
+        // Already have a platform with this name, just select it
+        m_opaque_sp->GetPlatformList().SetSelectedPlatform(platform_sp);
+      } else {
+        // We don't have a platform by this name yet, create one
+        platform_sp = Platform::Create(platform_name, sb_error.ref());
+        if (platform_sp) {
+          // We created the platform, now append and select it
+          bool make_selected = true;
+          m_opaque_sp->GetPlatformList().Append(platform_sp, make_selected);
         }
+      }
+    } else {
+      sb_error.ref().SetErrorString("invalid platform name");
     }
-    else
-    {
-        sb_error.ref().SetErrorString("invalid debugger");
-    }
-    return sb_error;
+  } else {
+    sb_error.ref().SetErrorString("invalid debugger");
+  }
+  return sb_error;
 }
 
-bool
-SBDebugger::SetCurrentPlatformSDKRoot (const char *sysroot)
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (m_opaque_sp)
-    {
-        PlatformSP platform_sp (m_opaque_sp->GetPlatformList().GetSelectedPlatform());
-        
-        if (platform_sp)
-        {
-            if (log && sysroot)
-                log->Printf ("SBDebugger::SetCurrentPlatformSDKRoot (\"%s\")", sysroot);
-            platform_sp->SetSDKRootDirectory (ConstString (sysroot));
-            return true;
-        }
+bool SBDebugger::SetCurrentPlatformSDKRoot(const char *sysroot) {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (m_opaque_sp) {
+    PlatformSP platform_sp(
+        m_opaque_sp->GetPlatformList().GetSelectedPlatform());
+
+    if (platform_sp) {
+      if (log && sysroot)
+        log->Printf("SBDebugger::SetCurrentPlatformSDKRoot (\"%s\")", sysroot);
+      platform_sp->SetSDKRootDirectory(ConstString(sysroot));
+      return true;
     }
-    return false;
+  }
+  return false;
 }
 
-bool
-SBDebugger::GetCloseInputOnEOF() const
-{
-    return (m_opaque_sp ? m_opaque_sp->GetCloseInputOnEOF() : false);
+bool SBDebugger::GetCloseInputOnEOF() const {
+  return (m_opaque_sp ? m_opaque_sp->GetCloseInputOnEOF() : false);
 }
 
-void
-SBDebugger::SetCloseInputOnEOF (bool b)
-{
-    if (m_opaque_sp)
-        m_opaque_sp->SetCloseInputOnEOF (b);
+void SBDebugger::SetCloseInputOnEOF(bool b) {
+  if (m_opaque_sp)
+    m_opaque_sp->SetCloseInputOnEOF(b);
 }
 
-SBTypeCategory
-SBDebugger::GetCategory (const char* category_name)
-{
-    if (!category_name || *category_name == 0)
-        return SBTypeCategory();
-    
-    TypeCategoryImplSP category_sp;
-    
-    if (DataVisualization::Categories::GetCategory(ConstString(category_name), category_sp, false))
-        return SBTypeCategory(category_sp);
-    else
-        return SBTypeCategory();
+SBTypeCategory SBDebugger::GetCategory(const char *category_name) {
+  if (!category_name || *category_name == 0)
+    return SBTypeCategory();
+
+  TypeCategoryImplSP category_sp;
+
+  if (DataVisualization::Categories::GetCategory(ConstString(category_name),
+                                                 category_sp, false))
+    return SBTypeCategory(category_sp);
+  else
+    return SBTypeCategory();
 }
 
-SBTypeCategory
-SBDebugger::GetCategory (lldb::LanguageType lang_type)
-{
-    TypeCategoryImplSP category_sp;
-    if (DataVisualization::Categories::GetCategory(lang_type, category_sp))
-        return SBTypeCategory(category_sp);
-    else
-        return SBTypeCategory();
+SBTypeCategory SBDebugger::GetCategory(lldb::LanguageType lang_type) {
+  TypeCategoryImplSP category_sp;
+  if (DataVisualization::Categories::GetCategory(lang_type, category_sp))
+    return SBTypeCategory(category_sp);
+  else
+    return SBTypeCategory();
 }
 
-SBTypeCategory
-SBDebugger::CreateCategory (const char* category_name)
-{
-    if (!category_name || *category_name == 0)
-        return SBTypeCategory();
-    
-    TypeCategoryImplSP category_sp;
-    
-    if (DataVisualization::Categories::GetCategory(ConstString(category_name), category_sp, true))
-        return SBTypeCategory(category_sp);
-    else
-        return SBTypeCategory();
+SBTypeCategory SBDebugger::CreateCategory(const char *category_name) {
+  if (!category_name || *category_name == 0)
+    return SBTypeCategory();
+
+  TypeCategoryImplSP category_sp;
+
+  if (DataVisualization::Categories::GetCategory(ConstString(category_name),
+                                                 category_sp, true))
+    return SBTypeCategory(category_sp);
+  else
+    return SBTypeCategory();
 }
 
-bool
-SBDebugger::DeleteCategory (const char* category_name)
-{
-    if (!category_name || *category_name == 0)
-        return false;
-    
-    return DataVisualization::Categories::Delete(ConstString(category_name));
+bool SBDebugger::DeleteCategory(const char *category_name) {
+  if (!category_name || *category_name == 0)
+    return false;
+
+  return DataVisualization::Categories::Delete(ConstString(category_name));
 }
 
-uint32_t
-SBDebugger::GetNumCategories()
-{
-    return DataVisualization::Categories::GetCount();
+uint32_t SBDebugger::GetNumCategories() {
+  return DataVisualization::Categories::GetCount();
 }
 
-SBTypeCategory
-SBDebugger::GetCategoryAtIndex (uint32_t index)
-{
-    return SBTypeCategory(DataVisualization::Categories::GetCategoryAtIndex(index));
+SBTypeCategory SBDebugger::GetCategoryAtIndex(uint32_t index) {
+  return SBTypeCategory(
+      DataVisualization::Categories::GetCategoryAtIndex(index));
 }
 
-SBTypeCategory
-SBDebugger::GetDefaultCategory()
-{
-    return GetCategory("default");
+SBTypeCategory SBDebugger::GetDefaultCategory() {
+  return GetCategory("default");
 }
 
-SBTypeFormat
-SBDebugger::GetFormatForType (SBTypeNameSpecifier type_name)
-{
-    SBTypeCategory default_category_sb = GetDefaultCategory();
-    if (default_category_sb.GetEnabled())
-        return default_category_sb.GetFormatForType(type_name);
-    return SBTypeFormat();
+SBTypeFormat SBDebugger::GetFormatForType(SBTypeNameSpecifier type_name) {
+  SBTypeCategory default_category_sb = GetDefaultCategory();
+  if (default_category_sb.GetEnabled())
+    return default_category_sb.GetFormatForType(type_name);
+  return SBTypeFormat();
 }
 
 #ifndef LLDB_DISABLE_PYTHON
-SBTypeSummary
-SBDebugger::GetSummaryForType (SBTypeNameSpecifier type_name)
-{
-    if (!type_name.IsValid())
-        return SBTypeSummary();
-    return SBTypeSummary(DataVisualization::GetSummaryForType(type_name.GetSP()));
+SBTypeSummary SBDebugger::GetSummaryForType(SBTypeNameSpecifier type_name) {
+  if (!type_name.IsValid())
+    return SBTypeSummary();
+  return SBTypeSummary(DataVisualization::GetSummaryForType(type_name.GetSP()));
 }
 #endif // LLDB_DISABLE_PYTHON
 
-SBTypeFilter
-SBDebugger::GetFilterForType (SBTypeNameSpecifier type_name)
-{
-    if (!type_name.IsValid())
-        return SBTypeFilter();
-    return SBTypeFilter(DataVisualization::GetFilterForType(type_name.GetSP()));
+SBTypeFilter SBDebugger::GetFilterForType(SBTypeNameSpecifier type_name) {
+  if (!type_name.IsValid())
+    return SBTypeFilter();
+  return SBTypeFilter(DataVisualization::GetFilterForType(type_name.GetSP()));
 }
 
 #ifndef LLDB_DISABLE_PYTHON
-SBTypeSynthetic
-SBDebugger::GetSyntheticForType (SBTypeNameSpecifier type_name)
-{
-    if (!type_name.IsValid())
-        return SBTypeSynthetic();
-    return SBTypeSynthetic(DataVisualization::GetSyntheticForType(type_name.GetSP()));
+SBTypeSynthetic SBDebugger::GetSyntheticForType(SBTypeNameSpecifier type_name) {
+  if (!type_name.IsValid())
+    return SBTypeSynthetic();
+  return SBTypeSynthetic(
+      DataVisualization::GetSyntheticForType(type_name.GetSP()));
 }
 #endif // LLDB_DISABLE_PYTHON
 
-bool
-SBDebugger::EnableLog (const char *channel, const char **categories)
-{
-    if (m_opaque_sp)
-    {
-        uint32_t log_options = LLDB_LOG_OPTION_PREPEND_TIMESTAMP | LLDB_LOG_OPTION_PREPEND_THREAD_NAME;
-        StreamString errors;
-        return m_opaque_sp->EnableLog(channel, categories, nullptr, log_options, errors);
-    }
-    else
-        return false;
+bool SBDebugger::EnableLog(const char *channel, const char **categories) {
+  if (m_opaque_sp) {
+    uint32_t log_options =
+        LLDB_LOG_OPTION_PREPEND_TIMESTAMP | LLDB_LOG_OPTION_PREPEND_THREAD_NAME;
+    StreamString errors;
+    return m_opaque_sp->EnableLog(channel, categories, nullptr, log_options,
+                                  errors);
+  } else
+    return false;
 }
 
-void
-SBDebugger::SetLoggingCallback (lldb::LogOutputCallback log_callback, void *baton)
-{
-    if (m_opaque_sp)
-    {
-        return m_opaque_sp->SetLoggingCallback (log_callback, baton);
-    }
+void SBDebugger::SetLoggingCallback(lldb::LogOutputCallback log_callback,
+                                    void *baton) {
+  if (m_opaque_sp) {
+    return m_opaque_sp->SetLoggingCallback(log_callback, baton);
+  }
 }

Modified: lldb/trunk/source/API/SBDeclaration.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBDeclaration.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBDeclaration.cpp (original)
+++ lldb/trunk/source/API/SBDeclaration.cpp Tue Sep  6 15:57:50 2016
@@ -1,4 +1,5 @@
-//===-- SBDeclaration.cpp -----------------------------------------*- C++ -*-===//
+//===-- SBDeclaration.cpp -----------------------------------------*- C++
+//-*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -18,192 +19,135 @@
 using namespace lldb;
 using namespace lldb_private;
 
+SBDeclaration::SBDeclaration() : m_opaque_ap() {}
 
-SBDeclaration::SBDeclaration () :
-    m_opaque_ap ()
-{
+SBDeclaration::SBDeclaration(const SBDeclaration &rhs) : m_opaque_ap() {
+  if (rhs.IsValid())
+    ref() = rhs.ref();
 }
 
-SBDeclaration::SBDeclaration (const SBDeclaration &rhs) :
-    m_opaque_ap ()
-{
-    if (rhs.IsValid())
-        ref() = rhs.ref();
+SBDeclaration::SBDeclaration(const lldb_private::Declaration *lldb_object_ptr)
+    : m_opaque_ap() {
+  if (lldb_object_ptr)
+    ref() = *lldb_object_ptr;
 }
 
-SBDeclaration::SBDeclaration (const lldb_private::Declaration *lldb_object_ptr) :
-    m_opaque_ap ()
-{
-    if (lldb_object_ptr)
-        ref() = *lldb_object_ptr;
+const SBDeclaration &SBDeclaration::operator=(const SBDeclaration &rhs) {
+  if (this != &rhs) {
+    if (rhs.IsValid())
+      ref() = rhs.ref();
+    else
+      m_opaque_ap.reset();
+  }
+  return *this;
 }
 
-const SBDeclaration &
-SBDeclaration::operator = (const SBDeclaration &rhs)
-{
-    if (this != &rhs)
-    {
-        if (rhs.IsValid())
-            ref() = rhs.ref();
-        else
-            m_opaque_ap.reset();
-    }
-    return *this;
+void SBDeclaration::SetDeclaration(
+    const lldb_private::Declaration &lldb_object_ref) {
+  ref() = lldb_object_ref;
 }
 
-void
-SBDeclaration::SetDeclaration (const lldb_private::Declaration &lldb_object_ref)
-{
-    ref() = lldb_object_ref;
+SBDeclaration::~SBDeclaration() {}
+
+bool SBDeclaration::IsValid() const {
+  return m_opaque_ap.get() && m_opaque_ap->IsValid();
 }
 
+SBFileSpec SBDeclaration::GetFileSpec() const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-SBDeclaration::~SBDeclaration ()
-{
-}
+  SBFileSpec sb_file_spec;
+  if (m_opaque_ap.get() && m_opaque_ap->GetFile())
+    sb_file_spec.SetFileSpec(m_opaque_ap->GetFile());
 
+  if (log) {
+    SBStream sstr;
+    sb_file_spec.GetDescription(sstr);
+    log->Printf("SBLineEntry(%p)::GetFileSpec () => SBFileSpec(%p): %s",
+                static_cast<void *>(m_opaque_ap.get()),
+                static_cast<const void *>(sb_file_spec.get()), sstr.GetData());
+  }
 
-bool
-SBDeclaration::IsValid () const
-{
-    return m_opaque_ap.get() && m_opaque_ap->IsValid();
+  return sb_file_spec;
 }
 
+uint32_t SBDeclaration::GetLine() const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-SBFileSpec
-SBDeclaration::GetFileSpec () const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+  uint32_t line = 0;
+  if (m_opaque_ap.get())
+    line = m_opaque_ap->GetLine();
 
-    SBFileSpec sb_file_spec;
-    if (m_opaque_ap.get() && m_opaque_ap->GetFile())
-        sb_file_spec.SetFileSpec(m_opaque_ap->GetFile());
+  if (log)
+    log->Printf("SBLineEntry(%p)::GetLine () => %u",
+                static_cast<void *>(m_opaque_ap.get()), line);
 
-    if (log)
-    {
-        SBStream sstr;
-        sb_file_spec.GetDescription (sstr);
-        log->Printf ("SBLineEntry(%p)::GetFileSpec () => SBFileSpec(%p): %s",
-                     static_cast<void*>(m_opaque_ap.get()),
-                     static_cast<const void*>(sb_file_spec.get()),
-                     sstr.GetData());
-    }
+  return line;
+}
+
+uint32_t SBDeclaration::GetColumn() const {
+  if (m_opaque_ap.get())
+    return m_opaque_ap->GetColumn();
+  return 0;
+}
 
-    return sb_file_spec;
+void SBDeclaration::SetFileSpec(lldb::SBFileSpec filespec) {
+  if (filespec.IsValid())
+    ref().SetFile(filespec.ref());
+  else
+    ref().SetFile(FileSpec());
 }
+void SBDeclaration::SetLine(uint32_t line) { ref().SetLine(line); }
 
-uint32_t
-SBDeclaration::GetLine () const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+void SBDeclaration::SetColumn(uint32_t column) { ref().SetColumn(column); }
 
-    uint32_t line = 0;
-    if (m_opaque_ap.get())
-        line = m_opaque_ap->GetLine();
+bool SBDeclaration::operator==(const SBDeclaration &rhs) const {
+  lldb_private::Declaration *lhs_ptr = m_opaque_ap.get();
+  lldb_private::Declaration *rhs_ptr = rhs.m_opaque_ap.get();
 
-    if (log)
-        log->Printf ("SBLineEntry(%p)::GetLine () => %u",
-                     static_cast<void*>(m_opaque_ap.get()), line);
+  if (lhs_ptr && rhs_ptr)
+    return lldb_private::Declaration::Compare(*lhs_ptr, *rhs_ptr) == 0;
 
-    return line;
+  return lhs_ptr == rhs_ptr;
 }
 
+bool SBDeclaration::operator!=(const SBDeclaration &rhs) const {
+  lldb_private::Declaration *lhs_ptr = m_opaque_ap.get();
+  lldb_private::Declaration *rhs_ptr = rhs.m_opaque_ap.get();
+
+  if (lhs_ptr && rhs_ptr)
+    return lldb_private::Declaration::Compare(*lhs_ptr, *rhs_ptr) != 0;
 
-uint32_t
-SBDeclaration::GetColumn () const
-{
-    if (m_opaque_ap.get())
-        return m_opaque_ap->GetColumn();
-    return 0;
+  return lhs_ptr != rhs_ptr;
 }
 
-void
-SBDeclaration::SetFileSpec (lldb::SBFileSpec filespec)
-{
-    if (filespec.IsValid())
-        ref().SetFile(filespec.ref());
-    else
-        ref().SetFile(FileSpec());
+const lldb_private::Declaration *SBDeclaration::operator->() const {
+  return m_opaque_ap.get();
 }
-void
-SBDeclaration::SetLine (uint32_t line)
-{
-    ref().SetLine(line);
-}
-
-void
-SBDeclaration::SetColumn (uint32_t column)
-{
-    ref().SetColumn(column);
-}
-
-
-
-bool
-SBDeclaration::operator == (const SBDeclaration &rhs) const
-{
-    lldb_private::Declaration *lhs_ptr = m_opaque_ap.get();
-    lldb_private::Declaration *rhs_ptr = rhs.m_opaque_ap.get();
-    
-    if (lhs_ptr && rhs_ptr)
-        return lldb_private::Declaration::Compare (*lhs_ptr, *rhs_ptr) == 0;
-    
-    return lhs_ptr == rhs_ptr;
-}
-
-bool
-SBDeclaration::operator != (const SBDeclaration &rhs) const
-{
-    lldb_private::Declaration *lhs_ptr = m_opaque_ap.get();
-    lldb_private::Declaration *rhs_ptr = rhs.m_opaque_ap.get();
-    
-    if (lhs_ptr && rhs_ptr)
-        return lldb_private::Declaration::Compare (*lhs_ptr, *rhs_ptr) != 0;
-    
-    return lhs_ptr != rhs_ptr;
-}
-
-const lldb_private::Declaration *
-SBDeclaration::operator->() const
-{
-    return m_opaque_ap.get();
-}
-
-lldb_private::Declaration &
-SBDeclaration::ref()
-{
-    if (m_opaque_ap.get() == NULL)
-        m_opaque_ap.reset (new lldb_private::Declaration ());
-    return *m_opaque_ap;
-}
-
-const lldb_private::Declaration &
-SBDeclaration::ref() const
-{
-    return *m_opaque_ap;
-}
-
-bool
-SBDeclaration::GetDescription (SBStream &description)
-{
-    Stream &strm = description.ref();
-    
-    if (m_opaque_ap.get())
-    {
-        char file_path[PATH_MAX*2];
-        m_opaque_ap->GetFile().GetPath (file_path, sizeof (file_path));
-        strm.Printf ("%s:%u", file_path, GetLine());
-        if (GetColumn() > 0)
-            strm.Printf (":%u", GetColumn());
-    }
-    else
-        strm.PutCString ("No value");
-    
-    return true;
+
+lldb_private::Declaration &SBDeclaration::ref() {
+  if (m_opaque_ap.get() == NULL)
+    m_opaque_ap.reset(new lldb_private::Declaration());
+  return *m_opaque_ap;
+}
+
+const lldb_private::Declaration &SBDeclaration::ref() const {
+  return *m_opaque_ap;
 }
 
-lldb_private::Declaration *
-SBDeclaration::get ()
-{
-    return m_opaque_ap.get();
+bool SBDeclaration::GetDescription(SBStream &description) {
+  Stream &strm = description.ref();
+
+  if (m_opaque_ap.get()) {
+    char file_path[PATH_MAX * 2];
+    m_opaque_ap->GetFile().GetPath(file_path, sizeof(file_path));
+    strm.Printf("%s:%u", file_path, GetLine());
+    if (GetColumn() > 0)
+      strm.Printf(":%u", GetColumn());
+  } else
+    strm.PutCString("No value");
+
+  return true;
 }
+
+lldb_private::Declaration *SBDeclaration::get() { return m_opaque_ap.get(); }

Modified: lldb/trunk/source/API/SBError.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBError.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBError.cpp (original)
+++ lldb/trunk/source/API/SBError.cpp Tue Sep  6 15:57:50 2016
@@ -17,221 +17,157 @@
 using namespace lldb;
 using namespace lldb_private;
 
+SBError::SBError() : m_opaque_ap() {}
 
-SBError::SBError () :
-    m_opaque_ap ()
-{
+SBError::SBError(const SBError &rhs) : m_opaque_ap() {
+  if (rhs.IsValid())
+    m_opaque_ap.reset(new Error(*rhs));
 }
 
-SBError::SBError (const SBError &rhs) :
-    m_opaque_ap ()
-{
-    if (rhs.IsValid())
-        m_opaque_ap.reset (new Error(*rhs));
-}
-
-
-SBError::~SBError()
-{
-}
+SBError::~SBError() {}
 
-const SBError &
-SBError::operator = (const SBError &rhs)
-{
-    if (rhs.IsValid())
-    {
-        if (m_opaque_ap.get())
-            *m_opaque_ap = *rhs;
-        else
-            m_opaque_ap.reset (new Error(*rhs));
-    }
+const SBError &SBError::operator=(const SBError &rhs) {
+  if (rhs.IsValid()) {
+    if (m_opaque_ap.get())
+      *m_opaque_ap = *rhs;
     else
-        m_opaque_ap.reset();
+      m_opaque_ap.reset(new Error(*rhs));
+  } else
+    m_opaque_ap.reset();
 
-    return *this;
+  return *this;
 }
 
-
-const char *
-SBError::GetCString () const
-{
-    if (m_opaque_ap.get())
-        return m_opaque_ap->AsCString();
-    return NULL;
+const char *SBError::GetCString() const {
+  if (m_opaque_ap.get())
+    return m_opaque_ap->AsCString();
+  return NULL;
 }
 
-void
-SBError::Clear ()
-{
-    if (m_opaque_ap.get())
-        m_opaque_ap->Clear();
+void SBError::Clear() {
+  if (m_opaque_ap.get())
+    m_opaque_ap->Clear();
 }
 
-bool
-SBError::Fail () const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+bool SBError::Fail() const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-    bool ret_value = false;
-    if (m_opaque_ap.get())
-        ret_value = m_opaque_ap->Fail();
+  bool ret_value = false;
+  if (m_opaque_ap.get())
+    ret_value = m_opaque_ap->Fail();
 
-    if (log)
-        log->Printf ("SBError(%p)::Fail () => %i",
-                     static_cast<void*>(m_opaque_ap.get()), ret_value);
+  if (log)
+    log->Printf("SBError(%p)::Fail () => %i",
+                static_cast<void *>(m_opaque_ap.get()), ret_value);
 
-    return ret_value;
+  return ret_value;
 }
 
-bool
-SBError::Success () const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    bool ret_value = true;
-    if (m_opaque_ap.get())
-        ret_value = m_opaque_ap->Success();
+bool SBError::Success() const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  bool ret_value = true;
+  if (m_opaque_ap.get())
+    ret_value = m_opaque_ap->Success();
 
-    if (log)
-        log->Printf ("SBError(%p)::Success () => %i",
-                     static_cast<void*>(m_opaque_ap.get()), ret_value);
+  if (log)
+    log->Printf("SBError(%p)::Success () => %i",
+                static_cast<void *>(m_opaque_ap.get()), ret_value);
 
-    return ret_value;
+  return ret_value;
 }
 
-uint32_t
-SBError::GetError () const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+uint32_t SBError::GetError() const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-    uint32_t err = 0;
-    if (m_opaque_ap.get())
-        err = m_opaque_ap->GetError();
-
-    if (log)
-        log->Printf ("SBError(%p)::GetError () => 0x%8.8x",
-                     static_cast<void*>(m_opaque_ap.get()), err);
+  uint32_t err = 0;
+  if (m_opaque_ap.get())
+    err = m_opaque_ap->GetError();
 
+  if (log)
+    log->Printf("SBError(%p)::GetError () => 0x%8.8x",
+                static_cast<void *>(m_opaque_ap.get()), err);
 
-    return err;
+  return err;
 }
 
-ErrorType
-SBError::GetType () const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    ErrorType err_type = eErrorTypeInvalid;
-    if (m_opaque_ap.get())
-        err_type = m_opaque_ap->GetType();
+ErrorType SBError::GetType() const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  ErrorType err_type = eErrorTypeInvalid;
+  if (m_opaque_ap.get())
+    err_type = m_opaque_ap->GetType();
 
-    if (log)
-        log->Printf ("SBError(%p)::GetType () => %i",
-                     static_cast<void*>(m_opaque_ap.get()), err_type);
+  if (log)
+    log->Printf("SBError(%p)::GetType () => %i",
+                static_cast<void *>(m_opaque_ap.get()), err_type);
 
-    return err_type;
+  return err_type;
 }
 
-void
-SBError::SetError (uint32_t err, ErrorType type)
-{
-    CreateIfNeeded ();
-    m_opaque_ap->SetError (err, type);
+void SBError::SetError(uint32_t err, ErrorType type) {
+  CreateIfNeeded();
+  m_opaque_ap->SetError(err, type);
 }
 
-void
-SBError::SetError (const Error &lldb_error)
-{
-    CreateIfNeeded ();
-    *m_opaque_ap = lldb_error;
+void SBError::SetError(const Error &lldb_error) {
+  CreateIfNeeded();
+  *m_opaque_ap = lldb_error;
 }
 
-
-void
-SBError::SetErrorToErrno ()
-{
-    CreateIfNeeded ();
-    m_opaque_ap->SetErrorToErrno ();
+void SBError::SetErrorToErrno() {
+  CreateIfNeeded();
+  m_opaque_ap->SetErrorToErrno();
 }
 
-void
-SBError::SetErrorToGenericError ()
-{
-    CreateIfNeeded ();
-    m_opaque_ap->SetErrorToErrno ();
+void SBError::SetErrorToGenericError() {
+  CreateIfNeeded();
+  m_opaque_ap->SetErrorToErrno();
 }
 
-void
-SBError::SetErrorString (const char *err_str)
-{
-    CreateIfNeeded ();
-    m_opaque_ap->SetErrorString (err_str);
+void SBError::SetErrorString(const char *err_str) {
+  CreateIfNeeded();
+  m_opaque_ap->SetErrorString(err_str);
 }
 
-int
-SBError::SetErrorStringWithFormat (const char *format, ...)
-{
-    CreateIfNeeded ();
-    va_list args;
-    va_start (args, format);
-    int num_chars = m_opaque_ap->SetErrorStringWithVarArg (format, args);
-    va_end (args);
-    return num_chars;
+int SBError::SetErrorStringWithFormat(const char *format, ...) {
+  CreateIfNeeded();
+  va_list args;
+  va_start(args, format);
+  int num_chars = m_opaque_ap->SetErrorStringWithVarArg(format, args);
+  va_end(args);
+  return num_chars;
 }
 
-bool
-SBError::IsValid () const
-{
-    return m_opaque_ap.get() != NULL;
-}
+bool SBError::IsValid() const { return m_opaque_ap.get() != NULL; }
 
-void
-SBError::CreateIfNeeded ()
-{
-    if (m_opaque_ap.get() == NULL)
-        m_opaque_ap.reset(new Error ());
+void SBError::CreateIfNeeded() {
+  if (m_opaque_ap.get() == NULL)
+    m_opaque_ap.reset(new Error());
 }
 
+lldb_private::Error *SBError::operator->() { return m_opaque_ap.get(); }
 
-lldb_private::Error *
-SBError::operator->()
-{
-    return m_opaque_ap.get();
-}
+lldb_private::Error *SBError::get() { return m_opaque_ap.get(); }
 
-lldb_private::Error *
-SBError::get()
-{
-    return m_opaque_ap.get();
+lldb_private::Error &SBError::ref() {
+  CreateIfNeeded();
+  return *m_opaque_ap;
 }
 
-lldb_private::Error &
-SBError::ref()
-{
-    CreateIfNeeded();
-    return *m_opaque_ap;
+const lldb_private::Error &SBError::operator*() const {
+  // Be sure to call "IsValid()" before calling this function or it will crash
+  return *m_opaque_ap;
 }
 
-const lldb_private::Error &
-SBError::operator*() const
-{
-    // Be sure to call "IsValid()" before calling this function or it will crash
-    return *m_opaque_ap;
-}
-
-bool
-SBError::GetDescription (SBStream &description)
-{
-    if (m_opaque_ap.get())
-    {
-        if (m_opaque_ap->Success())
-            description.Printf ("success");
-        else
-        {
-            const char * err_string = GetCString();
-            description.Printf ("error: %s",  (err_string != NULL ? err_string : ""));
-        }
+bool SBError::GetDescription(SBStream &description) {
+  if (m_opaque_ap.get()) {
+    if (m_opaque_ap->Success())
+      description.Printf("success");
+    else {
+      const char *err_string = GetCString();
+      description.Printf("error: %s", (err_string != NULL ? err_string : ""));
     }
-    else
-        description.Printf ("error: <NULL>");
+  } else
+    description.Printf("error: <NULL>");
 
-    return true;
-} 
+  return true;
+}

Modified: lldb/trunk/source/API/SBEvent.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBEvent.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBEvent.cpp (original)
+++ lldb/trunk/source/API/SBEvent.cpp Tue Sep  6 15:57:50 2016
@@ -11,240 +11,181 @@
 #include "lldb/API/SBBroadcaster.h"
 #include "lldb/API/SBStream.h"
 
+#include "lldb/Breakpoint/Breakpoint.h"
+#include "lldb/Core/ConstString.h"
 #include "lldb/Core/Event.h"
 #include "lldb/Core/Stream.h"
 #include "lldb/Core/StreamFile.h"
-#include "lldb/Core/ConstString.h"
-#include "lldb/Target/Process.h"
-#include "lldb/Breakpoint/Breakpoint.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Target/Process.h"
 
 using namespace lldb;
 using namespace lldb_private;
 
+SBEvent::SBEvent() : m_event_sp(), m_opaque_ptr(NULL) {}
 
-SBEvent::SBEvent () :
-    m_event_sp (),
-    m_opaque_ptr (NULL)
-{
-}
-
-SBEvent::SBEvent (uint32_t event_type, const char *cstr, uint32_t cstr_len) :
-    m_event_sp (new Event (event_type, new EventDataBytes (cstr, cstr_len))),
-    m_opaque_ptr (m_event_sp.get())
-{
-}
-
-SBEvent::SBEvent (EventSP &event_sp) :
-    m_event_sp (event_sp),
-    m_opaque_ptr (event_sp.get())
-{
-}
-
-SBEvent::SBEvent (Event *event_ptr) :
-    m_event_sp (),
-    m_opaque_ptr (event_ptr)
-{
-}
-
-SBEvent::SBEvent (const SBEvent &rhs) :
-    m_event_sp (rhs.m_event_sp),
-    m_opaque_ptr (rhs.m_opaque_ptr)
-{
-    
-}
-    
-const SBEvent &
-SBEvent::operator = (const SBEvent &rhs)
-{
-    if (this != &rhs)
-    {
-        m_event_sp = rhs.m_event_sp;
-        m_opaque_ptr = rhs.m_opaque_ptr;
-    }
-    return *this;
-}
-
-SBEvent::~SBEvent()
-{
-}
-
-const char *
-SBEvent::GetDataFlavor ()
-{
-    Event *lldb_event = get();
-    if (lldb_event)
-    {
-        EventData *event_data = lldb_event->GetData();
-        if (event_data)
-            return lldb_event->GetData()->GetFlavor().AsCString();
-    }
-    return NULL;
-}
-
-uint32_t
-SBEvent::GetType () const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    const Event *lldb_event = get();
-    uint32_t event_type = 0;
-    if (lldb_event)
-        event_type = lldb_event->GetType();
-
-    if (log)
-    {
-        StreamString sstr;
-        if (lldb_event && lldb_event->GetBroadcaster() && lldb_event->GetBroadcaster()->GetEventNames(sstr, event_type, true))
-            log->Printf ("SBEvent(%p)::GetType () => 0x%8.8x (%s)",
-                         static_cast<void*>(get()), event_type, sstr.GetData());
-        else
-            log->Printf ("SBEvent(%p)::GetType () => 0x%8.8x",
-                         static_cast<void*>(get()), event_type);
-
-    }
-
-    return event_type;
-}
-
-SBBroadcaster
-SBEvent::GetBroadcaster () const
-{
-    SBBroadcaster broadcaster;
-    const Event *lldb_event = get();
-    if (lldb_event)
-        broadcaster.reset (lldb_event->GetBroadcaster(), false);
-    return broadcaster;
-}
-
-const char *
-SBEvent::GetBroadcasterClass () const
-{
-    const Event *lldb_event = get();
-    if (lldb_event)
-        return lldb_event->GetBroadcaster()->GetBroadcasterClass().AsCString();
+SBEvent::SBEvent(uint32_t event_type, const char *cstr, uint32_t cstr_len)
+    : m_event_sp(new Event(event_type, new EventDataBytes(cstr, cstr_len))),
+      m_opaque_ptr(m_event_sp.get()) {}
+
+SBEvent::SBEvent(EventSP &event_sp)
+    : m_event_sp(event_sp), m_opaque_ptr(event_sp.get()) {}
+
+SBEvent::SBEvent(Event *event_ptr) : m_event_sp(), m_opaque_ptr(event_ptr) {}
+
+SBEvent::SBEvent(const SBEvent &rhs)
+    : m_event_sp(rhs.m_event_sp), m_opaque_ptr(rhs.m_opaque_ptr) {}
+
+const SBEvent &SBEvent::operator=(const SBEvent &rhs) {
+  if (this != &rhs) {
+    m_event_sp = rhs.m_event_sp;
+    m_opaque_ptr = rhs.m_opaque_ptr;
+  }
+  return *this;
+}
+
+SBEvent::~SBEvent() {}
+
+const char *SBEvent::GetDataFlavor() {
+  Event *lldb_event = get();
+  if (lldb_event) {
+    EventData *event_data = lldb_event->GetData();
+    if (event_data)
+      return lldb_event->GetData()->GetFlavor().AsCString();
+  }
+  return NULL;
+}
+
+uint32_t SBEvent::GetType() const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  const Event *lldb_event = get();
+  uint32_t event_type = 0;
+  if (lldb_event)
+    event_type = lldb_event->GetType();
+
+  if (log) {
+    StreamString sstr;
+    if (lldb_event && lldb_event->GetBroadcaster() &&
+        lldb_event->GetBroadcaster()->GetEventNames(sstr, event_type, true))
+      log->Printf("SBEvent(%p)::GetType () => 0x%8.8x (%s)",
+                  static_cast<void *>(get()), event_type, sstr.GetData());
     else
-        return "unknown class";
+      log->Printf("SBEvent(%p)::GetType () => 0x%8.8x",
+                  static_cast<void *>(get()), event_type);
+  }
+
+  return event_type;
+}
+
+SBBroadcaster SBEvent::GetBroadcaster() const {
+  SBBroadcaster broadcaster;
+  const Event *lldb_event = get();
+  if (lldb_event)
+    broadcaster.reset(lldb_event->GetBroadcaster(), false);
+  return broadcaster;
 }
 
-bool
-SBEvent::BroadcasterMatchesPtr (const SBBroadcaster *broadcaster)
-{
-    if (broadcaster)
-        return BroadcasterMatchesRef (*broadcaster);
-    return false;
+const char *SBEvent::GetBroadcasterClass() const {
+  const Event *lldb_event = get();
+  if (lldb_event)
+    return lldb_event->GetBroadcaster()->GetBroadcasterClass().AsCString();
+  else
+    return "unknown class";
 }
 
-bool
-SBEvent::BroadcasterMatchesRef (const SBBroadcaster &broadcaster)
-{
+bool SBEvent::BroadcasterMatchesPtr(const SBBroadcaster *broadcaster) {
+  if (broadcaster)
+    return BroadcasterMatchesRef(*broadcaster);
+  return false;
+}
 
-    Event *lldb_event = get();
-    bool success = false;
-    if (lldb_event)
-        success = lldb_event->BroadcasterIs (broadcaster.get());
+bool SBEvent::BroadcasterMatchesRef(const SBBroadcaster &broadcaster) {
 
-    // For logging, this gets a little chatty so only enable this when verbose logging is on
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE));
-    if (log)
-        log->Printf ("SBEvent(%p)::BroadcasterMatchesRef (SBBroadcaster(%p): %s) => %i",
-                     static_cast<void*>(get()),
-                     static_cast<void*>(broadcaster.get()),
-                     broadcaster.GetName(), success);
+  Event *lldb_event = get();
+  bool success = false;
+  if (lldb_event)
+    success = lldb_event->BroadcasterIs(broadcaster.get());
 
-    return success;
-}
+  // For logging, this gets a little chatty so only enable this when verbose
+  // logging is on
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API |
+                                                  LIBLLDB_LOG_VERBOSE));
+  if (log)
+    log->Printf(
+        "SBEvent(%p)::BroadcasterMatchesRef (SBBroadcaster(%p): %s) => %i",
+        static_cast<void *>(get()), static_cast<void *>(broadcaster.get()),
+        broadcaster.GetName(), success);
 
-void
-SBEvent::Clear()
-{
-    Event *lldb_event = get();
-    if (lldb_event)
-        lldb_event->Clear();
+  return success;
 }
 
-EventSP &
-SBEvent::GetSP () const
-{
-    return m_event_sp;
+void SBEvent::Clear() {
+  Event *lldb_event = get();
+  if (lldb_event)
+    lldb_event->Clear();
 }
 
-Event *
-SBEvent::get() const
-{
-    // There is a dangerous accessor call GetSharedPtr which can be used, so if
-    // we have anything valid in m_event_sp, we must use that since if it gets
-    // used by a function that puts something in there, then it won't update
-    // m_opaque_ptr...
-    if (m_event_sp)
-        m_opaque_ptr = m_event_sp.get();
+EventSP &SBEvent::GetSP() const { return m_event_sp; }
 
-    return m_opaque_ptr;
-}
-
-void
-SBEvent::reset (EventSP &event_sp)
-{
-    m_event_sp = event_sp;
+Event *SBEvent::get() const {
+  // There is a dangerous accessor call GetSharedPtr which can be used, so if
+  // we have anything valid in m_event_sp, we must use that since if it gets
+  // used by a function that puts something in there, then it won't update
+  // m_opaque_ptr...
+  if (m_event_sp)
     m_opaque_ptr = m_event_sp.get();
+
+  return m_opaque_ptr;
 }
 
-void
-SBEvent::reset (Event* event_ptr)
-{
-    m_opaque_ptr = event_ptr;
-    m_event_sp.reset();
+void SBEvent::reset(EventSP &event_sp) {
+  m_event_sp = event_sp;
+  m_opaque_ptr = m_event_sp.get();
 }
 
-bool
-SBEvent::IsValid() const
-{
-    // Do NOT use m_opaque_ptr directly!!! Must use the SBEvent::get()
-    // accessor. See comments in SBEvent::get()....
-    return SBEvent::get() != NULL;
+void SBEvent::reset(Event *event_ptr) {
+  m_opaque_ptr = event_ptr;
+  m_event_sp.reset();
+}
 
+bool SBEvent::IsValid() const {
+  // Do NOT use m_opaque_ptr directly!!! Must use the SBEvent::get()
+  // accessor. See comments in SBEvent::get()....
+  return SBEvent::get() != NULL;
 }
 
-const char *
-SBEvent::GetCStringFromEvent (const SBEvent &event)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+const char *SBEvent::GetCStringFromEvent(const SBEvent &event) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-    if (log)
-        log->Printf ("SBEvent(%p)::GetCStringFromEvent () => \"%s\"",
-                     static_cast<void*>(event.get()),
-                     reinterpret_cast<const char *>(EventDataBytes::GetBytesFromEvent (event.get())));
+  if (log)
+    log->Printf("SBEvent(%p)::GetCStringFromEvent () => \"%s\"",
+                static_cast<void *>(event.get()),
+                reinterpret_cast<const char *>(
+                    EventDataBytes::GetBytesFromEvent(event.get())));
 
-    return reinterpret_cast<const char *>(EventDataBytes::GetBytesFromEvent (event.get()));
+  return reinterpret_cast<const char *>(
+      EventDataBytes::GetBytesFromEvent(event.get()));
 }
 
+bool SBEvent::GetDescription(SBStream &description) {
+  Stream &strm = description.ref();
 
-bool
-SBEvent::GetDescription (SBStream &description)
-{
-    Stream &strm = description.ref();
-
-    if (get())
-    {
-        m_opaque_ptr->Dump (&strm);
-    }
-    else
-        strm.PutCString ("No value");
+  if (get()) {
+    m_opaque_ptr->Dump(&strm);
+  } else
+    strm.PutCString("No value");
 
-    return true;
+  return true;
 }
 
-bool
-SBEvent::GetDescription (SBStream &description) const
-{
-    Stream &strm = description.ref();
+bool SBEvent::GetDescription(SBStream &description) const {
+  Stream &strm = description.ref();
 
-    if (get())
-    {
-        m_opaque_ptr->Dump (&strm);
-    }
-    else
-        strm.PutCString ("No value");
+  if (get()) {
+    m_opaque_ptr->Dump(&strm);
+  } else
+    strm.PutCString("No value");
 
-    return true;
+  return true;
 }

Modified: lldb/trunk/source/API/SBExecutionContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBExecutionContext.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBExecutionContext.cpp (original)
+++ lldb/trunk/source/API/SBExecutionContext.cpp Tue Sep  6 15:57:50 2016
@@ -1,4 +1,5 @@
-//===-- SBExecutionContext.cpp ------------------------------------*- C++ -*-===//
+//===-- SBExecutionContext.cpp ------------------------------------*- C++
+//-*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -9,121 +10,93 @@
 
 #include "lldb/API/SBExecutionContext.h"
 
-#include "lldb/API/SBTarget.h"
+#include "lldb/API/SBFrame.h"
 #include "lldb/API/SBProcess.h"
+#include "lldb/API/SBTarget.h"
 #include "lldb/API/SBThread.h"
-#include "lldb/API/SBFrame.h"
 
 #include "lldb/Target/ExecutionContext.h"
 
 using namespace lldb;
 using namespace lldb_private;
 
-SBExecutionContext::SBExecutionContext() :
-m_exe_ctx_sp()
-{
-}
-
-SBExecutionContext::SBExecutionContext (const lldb::SBExecutionContext &rhs) :
-m_exe_ctx_sp(rhs.m_exe_ctx_sp)
-{
-}
-
-SBExecutionContext::SBExecutionContext (lldb::ExecutionContextRefSP exe_ctx_ref_sp) :
-m_exe_ctx_sp(exe_ctx_ref_sp)
-{
-}
-
-SBExecutionContext::SBExecutionContext (const lldb::SBTarget &target) :
-m_exe_ctx_sp(new ExecutionContextRef())
-{
-    m_exe_ctx_sp->SetTargetSP(target.GetSP());
-}
-
-SBExecutionContext::SBExecutionContext (const lldb::SBProcess &process) :
-m_exe_ctx_sp(new ExecutionContextRef())
-{
-    m_exe_ctx_sp->SetProcessSP(process.GetSP());
-}
-
-SBExecutionContext::SBExecutionContext (lldb::SBThread thread) :
-m_exe_ctx_sp(new ExecutionContextRef())
-{
-    m_exe_ctx_sp->SetThreadPtr(thread.get());
-}
-
-SBExecutionContext::SBExecutionContext (const lldb::SBFrame &frame) :
-m_exe_ctx_sp(new ExecutionContextRef())
-{
-    m_exe_ctx_sp->SetFrameSP(frame.GetFrameSP());
-}
-
-SBExecutionContext::~SBExecutionContext()
-{
-}
-
-const SBExecutionContext &
-SBExecutionContext::operator = (const lldb::SBExecutionContext &rhs)
-{
-    m_exe_ctx_sp = rhs.m_exe_ctx_sp;
-    return *this;
-}
-
-ExecutionContextRef *
-SBExecutionContext::get () const
-{
-    return m_exe_ctx_sp.get();
-}
-
-SBTarget
-SBExecutionContext::GetTarget () const
-{
-    SBTarget sb_target;
-    if (m_exe_ctx_sp)
-    {
-        TargetSP target_sp(m_exe_ctx_sp->GetTargetSP());
-        if (target_sp)
-            sb_target.SetSP(target_sp);
-    }
-    return sb_target;
-}
-
-SBProcess
-SBExecutionContext::GetProcess () const
-{
-    SBProcess sb_process;
-    if (m_exe_ctx_sp)
-    {
-        ProcessSP process_sp(m_exe_ctx_sp->GetProcessSP());
-        if (process_sp)
-            sb_process.SetSP(process_sp);
-    }
-    return sb_process;
-}
-
-SBThread
-SBExecutionContext::GetThread () const
-{
-    SBThread sb_thread;
-    if (m_exe_ctx_sp)
-    {
-        ThreadSP thread_sp(m_exe_ctx_sp->GetThreadSP());
-        if (thread_sp)
-            sb_thread.SetThread(thread_sp);
-    }
-    return sb_thread;
-}
-
-SBFrame
-SBExecutionContext::GetFrame () const
-{
-    SBFrame sb_frame;
-    if (m_exe_ctx_sp)
-    {
-        StackFrameSP frame_sp(m_exe_ctx_sp->GetFrameSP());
-        if (frame_sp)
-            sb_frame.SetFrameSP(frame_sp);
-    }
-    return sb_frame;
+SBExecutionContext::SBExecutionContext() : m_exe_ctx_sp() {}
+
+SBExecutionContext::SBExecutionContext(const lldb::SBExecutionContext &rhs)
+    : m_exe_ctx_sp(rhs.m_exe_ctx_sp) {}
+
+SBExecutionContext::SBExecutionContext(
+    lldb::ExecutionContextRefSP exe_ctx_ref_sp)
+    : m_exe_ctx_sp(exe_ctx_ref_sp) {}
+
+SBExecutionContext::SBExecutionContext(const lldb::SBTarget &target)
+    : m_exe_ctx_sp(new ExecutionContextRef()) {
+  m_exe_ctx_sp->SetTargetSP(target.GetSP());
+}
+
+SBExecutionContext::SBExecutionContext(const lldb::SBProcess &process)
+    : m_exe_ctx_sp(new ExecutionContextRef()) {
+  m_exe_ctx_sp->SetProcessSP(process.GetSP());
+}
+
+SBExecutionContext::SBExecutionContext(lldb::SBThread thread)
+    : m_exe_ctx_sp(new ExecutionContextRef()) {
+  m_exe_ctx_sp->SetThreadPtr(thread.get());
+}
+
+SBExecutionContext::SBExecutionContext(const lldb::SBFrame &frame)
+    : m_exe_ctx_sp(new ExecutionContextRef()) {
+  m_exe_ctx_sp->SetFrameSP(frame.GetFrameSP());
 }
 
+SBExecutionContext::~SBExecutionContext() {}
+
+const SBExecutionContext &SBExecutionContext::
+operator=(const lldb::SBExecutionContext &rhs) {
+  m_exe_ctx_sp = rhs.m_exe_ctx_sp;
+  return *this;
+}
+
+ExecutionContextRef *SBExecutionContext::get() const {
+  return m_exe_ctx_sp.get();
+}
+
+SBTarget SBExecutionContext::GetTarget() const {
+  SBTarget sb_target;
+  if (m_exe_ctx_sp) {
+    TargetSP target_sp(m_exe_ctx_sp->GetTargetSP());
+    if (target_sp)
+      sb_target.SetSP(target_sp);
+  }
+  return sb_target;
+}
+
+SBProcess SBExecutionContext::GetProcess() const {
+  SBProcess sb_process;
+  if (m_exe_ctx_sp) {
+    ProcessSP process_sp(m_exe_ctx_sp->GetProcessSP());
+    if (process_sp)
+      sb_process.SetSP(process_sp);
+  }
+  return sb_process;
+}
+
+SBThread SBExecutionContext::GetThread() const {
+  SBThread sb_thread;
+  if (m_exe_ctx_sp) {
+    ThreadSP thread_sp(m_exe_ctx_sp->GetThreadSP());
+    if (thread_sp)
+      sb_thread.SetThread(thread_sp);
+  }
+  return sb_thread;
+}
+
+SBFrame SBExecutionContext::GetFrame() const {
+  SBFrame sb_frame;
+  if (m_exe_ctx_sp) {
+    StackFrameSP frame_sp(m_exe_ctx_sp->GetFrameSP());
+    if (frame_sp)
+      sb_frame.SetFrameSP(frame_sp);
+  }
+  return sb_frame;
+}

Modified: lldb/trunk/source/API/SBExpressionOptions.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBExpressionOptions.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBExpressionOptions.cpp (original)
+++ lldb/trunk/source/API/SBExpressionOptions.cpp Tue Sep  6 15:57:50 2016
@@ -1,4 +1,5 @@
-//===-- SBExpressionOptions.cpp ---------------------------------------------*- C++ -*-===//
+//===-- SBExpressionOptions.cpp ---------------------------------------------*-
+//C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -15,220 +16,150 @@
 using namespace lldb;
 using namespace lldb_private;
 
+SBExpressionOptions::SBExpressionOptions()
+    : m_opaque_ap(new EvaluateExpressionOptions()) {}
 
-SBExpressionOptions::SBExpressionOptions () :
-    m_opaque_ap(new EvaluateExpressionOptions())
-{
+SBExpressionOptions::SBExpressionOptions(const SBExpressionOptions &rhs) {
+  m_opaque_ap.reset(new EvaluateExpressionOptions());
+  *(m_opaque_ap.get()) = rhs.ref();
 }
 
-SBExpressionOptions::SBExpressionOptions (const SBExpressionOptions &rhs)
-{
-    m_opaque_ap.reset(new EvaluateExpressionOptions());
-    *(m_opaque_ap.get()) = rhs.ref();
+const SBExpressionOptions &SBExpressionOptions::
+operator=(const SBExpressionOptions &rhs) {
+  if (this != &rhs) {
+    this->ref() = rhs.ref();
+  }
+  return *this;
 }
 
-const SBExpressionOptions &
-SBExpressionOptions::operator = (const SBExpressionOptions &rhs)
-{
-    if (this != &rhs)
-    {
-        this->ref() = rhs.ref();
-    }
-    return *this;
-}
-
-SBExpressionOptions::~SBExpressionOptions()
-{
-}
+SBExpressionOptions::~SBExpressionOptions() {}
 
-bool
-SBExpressionOptions::GetCoerceResultToId () const
-{
-    return m_opaque_ap->DoesCoerceToId ();
+bool SBExpressionOptions::GetCoerceResultToId() const {
+  return m_opaque_ap->DoesCoerceToId();
 }
 
-void
-SBExpressionOptions::SetCoerceResultToId (bool coerce)
-{
-    m_opaque_ap->SetCoerceToId (coerce);
+void SBExpressionOptions::SetCoerceResultToId(bool coerce) {
+  m_opaque_ap->SetCoerceToId(coerce);
 }
 
-bool
-SBExpressionOptions::GetUnwindOnError () const
-{
-    return m_opaque_ap->DoesUnwindOnError ();
+bool SBExpressionOptions::GetUnwindOnError() const {
+  return m_opaque_ap->DoesUnwindOnError();
 }
 
-void
-SBExpressionOptions::SetUnwindOnError (bool unwind)
-{
-    m_opaque_ap->SetUnwindOnError (unwind);
+void SBExpressionOptions::SetUnwindOnError(bool unwind) {
+  m_opaque_ap->SetUnwindOnError(unwind);
 }
 
-bool
-SBExpressionOptions::GetIgnoreBreakpoints () const
-{
-    return m_opaque_ap->DoesIgnoreBreakpoints ();
+bool SBExpressionOptions::GetIgnoreBreakpoints() const {
+  return m_opaque_ap->DoesIgnoreBreakpoints();
 }
 
-void
-SBExpressionOptions::SetIgnoreBreakpoints (bool ignore)
-{
-    m_opaque_ap->SetIgnoreBreakpoints (ignore);
+void SBExpressionOptions::SetIgnoreBreakpoints(bool ignore) {
+  m_opaque_ap->SetIgnoreBreakpoints(ignore);
 }
 
-lldb::DynamicValueType
-SBExpressionOptions::GetFetchDynamicValue () const
-{
-    return m_opaque_ap->GetUseDynamic ();
+lldb::DynamicValueType SBExpressionOptions::GetFetchDynamicValue() const {
+  return m_opaque_ap->GetUseDynamic();
 }
 
-void
-SBExpressionOptions::SetFetchDynamicValue (lldb::DynamicValueType dynamic)
-{
-    m_opaque_ap->SetUseDynamic (dynamic);
+void SBExpressionOptions::SetFetchDynamicValue(lldb::DynamicValueType dynamic) {
+  m_opaque_ap->SetUseDynamic(dynamic);
 }
 
-uint32_t
-SBExpressionOptions::GetTimeoutInMicroSeconds () const
-{
-    return m_opaque_ap->GetTimeoutUsec ();
+uint32_t SBExpressionOptions::GetTimeoutInMicroSeconds() const {
+  return m_opaque_ap->GetTimeoutUsec();
 }
 
-void
-SBExpressionOptions::SetTimeoutInMicroSeconds (uint32_t timeout)
-{
-    m_opaque_ap->SetTimeoutUsec (timeout);
+void SBExpressionOptions::SetTimeoutInMicroSeconds(uint32_t timeout) {
+  m_opaque_ap->SetTimeoutUsec(timeout);
 }
 
-uint32_t
-SBExpressionOptions::GetOneThreadTimeoutInMicroSeconds () const
-{
-    return m_opaque_ap->GetOneThreadTimeoutUsec ();
+uint32_t SBExpressionOptions::GetOneThreadTimeoutInMicroSeconds() const {
+  return m_opaque_ap->GetOneThreadTimeoutUsec();
 }
 
-void
-SBExpressionOptions::SetOneThreadTimeoutInMicroSeconds (uint32_t timeout)
-{
-    m_opaque_ap->SetOneThreadTimeoutUsec (timeout);
+void SBExpressionOptions::SetOneThreadTimeoutInMicroSeconds(uint32_t timeout) {
+  m_opaque_ap->SetOneThreadTimeoutUsec(timeout);
 }
 
-bool
-SBExpressionOptions::GetTryAllThreads () const
-{
-    return m_opaque_ap->GetTryAllThreads ();
+bool SBExpressionOptions::GetTryAllThreads() const {
+  return m_opaque_ap->GetTryAllThreads();
 }
 
-void
-SBExpressionOptions::SetTryAllThreads (bool run_others)
-{
-    m_opaque_ap->SetTryAllThreads (run_others);
+void SBExpressionOptions::SetTryAllThreads(bool run_others) {
+  m_opaque_ap->SetTryAllThreads(run_others);
 }
 
-bool
-SBExpressionOptions::GetStopOthers () const
-{
-    return m_opaque_ap->GetStopOthers ();
+bool SBExpressionOptions::GetStopOthers() const {
+  return m_opaque_ap->GetStopOthers();
 }
 
-void
-SBExpressionOptions::SetStopOthers (bool run_others)
-{
-    m_opaque_ap->SetStopOthers (run_others);
+void SBExpressionOptions::SetStopOthers(bool run_others) {
+  m_opaque_ap->SetStopOthers(run_others);
 }
 
-bool
-SBExpressionOptions::GetTrapExceptions () const
-{
-    return m_opaque_ap->GetTrapExceptions ();
+bool SBExpressionOptions::GetTrapExceptions() const {
+  return m_opaque_ap->GetTrapExceptions();
 }
 
-void
-SBExpressionOptions::SetTrapExceptions (bool trap_exceptions)
-{
-    m_opaque_ap->SetTrapExceptions (trap_exceptions);
+void SBExpressionOptions::SetTrapExceptions(bool trap_exceptions) {
+  m_opaque_ap->SetTrapExceptions(trap_exceptions);
 }
 
-void
-SBExpressionOptions::SetLanguage (lldb::LanguageType language)
-{
-    m_opaque_ap->SetLanguage(language);
+void SBExpressionOptions::SetLanguage(lldb::LanguageType language) {
+  m_opaque_ap->SetLanguage(language);
 }
 
-void
-SBExpressionOptions::SetCancelCallback (lldb::ExpressionCancelCallback callback, void *baton)
-{
-    m_opaque_ap->SetCancelCallback (callback, baton);
+void SBExpressionOptions::SetCancelCallback(
+    lldb::ExpressionCancelCallback callback, void *baton) {
+  m_opaque_ap->SetCancelCallback(callback, baton);
 }
 
-bool
-SBExpressionOptions::GetGenerateDebugInfo ()
-{
-    return m_opaque_ap->GetGenerateDebugInfo();
+bool SBExpressionOptions::GetGenerateDebugInfo() {
+  return m_opaque_ap->GetGenerateDebugInfo();
 }
 
-void
-SBExpressionOptions::SetGenerateDebugInfo (bool b)
-{
-    return m_opaque_ap->SetGenerateDebugInfo(b);
+void SBExpressionOptions::SetGenerateDebugInfo(bool b) {
+  return m_opaque_ap->SetGenerateDebugInfo(b);
 }
 
-bool
-SBExpressionOptions::GetSuppressPersistentResult ()
-{
-    return m_opaque_ap->GetResultIsInternal ();
+bool SBExpressionOptions::GetSuppressPersistentResult() {
+  return m_opaque_ap->GetResultIsInternal();
 }
 
-void
-SBExpressionOptions::SetSuppressPersistentResult (bool b)
-{
-    return m_opaque_ap->SetResultIsInternal (b);
+void SBExpressionOptions::SetSuppressPersistentResult(bool b) {
+  return m_opaque_ap->SetResultIsInternal(b);
 }
 
-const char *
-SBExpressionOptions::GetPrefix () const
-{
-    return m_opaque_ap->GetPrefix();
+const char *SBExpressionOptions::GetPrefix() const {
+  return m_opaque_ap->GetPrefix();
 }
 
-void
-SBExpressionOptions::SetPrefix (const char *prefix)
-{
-    return m_opaque_ap->SetPrefix(prefix);
+void SBExpressionOptions::SetPrefix(const char *prefix) {
+  return m_opaque_ap->SetPrefix(prefix);
 }
 
-bool
-SBExpressionOptions::GetAutoApplyFixIts ()
-{
-    return m_opaque_ap->GetAutoApplyFixIts ();
+bool SBExpressionOptions::GetAutoApplyFixIts() {
+  return m_opaque_ap->GetAutoApplyFixIts();
 }
 
-void
-SBExpressionOptions::SetAutoApplyFixIts (bool b)
-{
-    return m_opaque_ap->SetAutoApplyFixIts (b);
+void SBExpressionOptions::SetAutoApplyFixIts(bool b) {
+  return m_opaque_ap->SetAutoApplyFixIts(b);
 }
 
-bool
-SBExpressionOptions::GetTopLevel ()
-{
-    return m_opaque_ap->GetExecutionPolicy() == eExecutionPolicyTopLevel;
+bool SBExpressionOptions::GetTopLevel() {
+  return m_opaque_ap->GetExecutionPolicy() == eExecutionPolicyTopLevel;
 }
 
-void
-SBExpressionOptions::SetTopLevel (bool b)
-{
-    m_opaque_ap->SetExecutionPolicy(b ? eExecutionPolicyTopLevel : m_opaque_ap->default_execution_policy);
+void SBExpressionOptions::SetTopLevel(bool b) {
+  m_opaque_ap->SetExecutionPolicy(b ? eExecutionPolicyTopLevel
+                                    : m_opaque_ap->default_execution_policy);
 }
 
-EvaluateExpressionOptions *
-SBExpressionOptions::get() const
-{
-    return m_opaque_ap.get();
+EvaluateExpressionOptions *SBExpressionOptions::get() const {
+  return m_opaque_ap.get();
 }
 
-EvaluateExpressionOptions &
-SBExpressionOptions::ref () const
-{
-    return *(m_opaque_ap.get());
+EvaluateExpressionOptions &SBExpressionOptions::ref() const {
+  return *(m_opaque_ap.get());
 }

Modified: lldb/trunk/source/API/SBFileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFileSpec.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFileSpec.cpp (original)
+++ lldb/trunk/source/API/SBFileSpec.cpp Tue Sep  6 15:57:50 2016
@@ -12,208 +12,155 @@
 
 #include "lldb/API/SBFileSpec.h"
 #include "lldb/API/SBStream.h"
-#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/Stream.h"
+#include "lldb/Host/FileSpec.h"
 
 #include "llvm/ADT/SmallString.h"
 
 using namespace lldb;
 using namespace lldb_private;
 
+SBFileSpec::SBFileSpec() : m_opaque_ap(new lldb_private::FileSpec()) {}
+
+SBFileSpec::SBFileSpec(const SBFileSpec &rhs)
+    : m_opaque_ap(new lldb_private::FileSpec(*rhs.m_opaque_ap)) {}
+
+SBFileSpec::SBFileSpec(const lldb_private::FileSpec &fspec)
+    : m_opaque_ap(new lldb_private::FileSpec(fspec)) {}
+
+// Deprecated!!!
+SBFileSpec::SBFileSpec(const char *path)
+    : m_opaque_ap(new FileSpec(path, true)) {}
+
+SBFileSpec::SBFileSpec(const char *path, bool resolve)
+    : m_opaque_ap(new FileSpec(path, resolve)) {}
 
+SBFileSpec::~SBFileSpec() {}
 
-SBFileSpec::SBFileSpec () :
-    m_opaque_ap(new lldb_private::FileSpec())
-{
+const SBFileSpec &SBFileSpec::operator=(const SBFileSpec &rhs) {
+  if (this != &rhs)
+    *m_opaque_ap = *rhs.m_opaque_ap;
+  return *this;
 }
 
-SBFileSpec::SBFileSpec (const SBFileSpec &rhs) :
-    m_opaque_ap(new lldb_private::FileSpec(*rhs.m_opaque_ap))
-{
+bool SBFileSpec::IsValid() const { return m_opaque_ap->operator bool(); }
+
+bool SBFileSpec::Exists() const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  bool result = m_opaque_ap->Exists();
+
+  if (log)
+    log->Printf("SBFileSpec(%p)::Exists () => %s",
+                static_cast<void *>(m_opaque_ap.get()),
+                (result ? "true" : "false"));
+
+  return result;
 }
 
-SBFileSpec::SBFileSpec (const lldb_private::FileSpec& fspec) :
-    m_opaque_ap(new lldb_private::FileSpec(fspec))
-{
+bool SBFileSpec::ResolveExecutableLocation() {
+  return m_opaque_ap->ResolveExecutableLocation();
 }
 
-// Deprecated!!!
-SBFileSpec::SBFileSpec (const char *path) :
-    m_opaque_ap(new FileSpec (path, true))
-{
-}
-
-SBFileSpec::SBFileSpec (const char *path, bool resolve) :
-    m_opaque_ap(new FileSpec (path, resolve))
-{
-}
-
-SBFileSpec::~SBFileSpec ()
-{
-}
-
-const SBFileSpec &
-SBFileSpec::operator = (const SBFileSpec &rhs)
-{
-    if (this != &rhs)
-        *m_opaque_ap = *rhs.m_opaque_ap;
-    return *this;
-}
-
-bool
-SBFileSpec::IsValid() const
-{
-    return m_opaque_ap->operator bool();
-}
-
-bool
-SBFileSpec::Exists () const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    bool result = m_opaque_ap->Exists();
-
-    if (log)
-        log->Printf ("SBFileSpec(%p)::Exists () => %s",
-                     static_cast<void*>(m_opaque_ap.get()),
-                     (result ? "true" : "false"));
-
-    return result;
-}
-
-bool
-SBFileSpec::ResolveExecutableLocation ()
-{
-    return m_opaque_ap->ResolveExecutableLocation ();
-}
-
-int
-SBFileSpec::ResolvePath (const char *src_path, char *dst_path, size_t dst_len)
-{
-    llvm::SmallString<64> result(src_path);
-    lldb_private::FileSpec::Resolve (result);
-    ::snprintf(dst_path, dst_len, "%s", result.c_str());
-    return std::min(dst_len-1, result.size());
-}
-
-const char *
-SBFileSpec::GetFilename() const
-{
-    const char *s = m_opaque_ap->GetFilename().AsCString();
-
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-    {
-        if (s)
-            log->Printf ("SBFileSpec(%p)::GetFilename () => \"%s\"",
-                         static_cast<void*>(m_opaque_ap.get()), s);
-        else
-            log->Printf ("SBFileSpec(%p)::GetFilename () => NULL",
-                         static_cast<void*>(m_opaque_ap.get()));
-    }
-
-    return s;
-}
-
-const char *
-SBFileSpec::GetDirectory() const
-{
-    FileSpec directory{*m_opaque_ap};
-    directory.GetFilename().Clear();
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-    {
-        if (directory)
-            log->Printf ("SBFileSpec(%p)::GetDirectory () => \"%s\"",
-                         static_cast<void*>(m_opaque_ap.get()), directory.GetCString());
-        else
-            log->Printf ("SBFileSpec(%p)::GetDirectory () => NULL",
-                         static_cast<void*>(m_opaque_ap.get()));
-    }
-    return directory.GetCString();
-}
-
-void
-SBFileSpec::SetFilename(const char *filename)
-{
-    if (filename && filename[0])
-        m_opaque_ap->GetFilename().SetCString(filename);
-    else
-        m_opaque_ap->GetFilename().Clear();
+int SBFileSpec::ResolvePath(const char *src_path, char *dst_path,
+                            size_t dst_len) {
+  llvm::SmallString<64> result(src_path);
+  lldb_private::FileSpec::Resolve(result);
+  ::snprintf(dst_path, dst_len, "%s", result.c_str());
+  return std::min(dst_len - 1, result.size());
 }
 
-void
-SBFileSpec::SetDirectory(const char *directory)
-{
-    if (directory && directory[0])
-        m_opaque_ap->GetDirectory().SetCString(directory);
+const char *SBFileSpec::GetFilename() const {
+  const char *s = m_opaque_ap->GetFilename().AsCString();
+
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log) {
+    if (s)
+      log->Printf("SBFileSpec(%p)::GetFilename () => \"%s\"",
+                  static_cast<void *>(m_opaque_ap.get()), s);
+    else
+      log->Printf("SBFileSpec(%p)::GetFilename () => NULL",
+                  static_cast<void *>(m_opaque_ap.get()));
+  }
+
+  return s;
+}
+
+const char *SBFileSpec::GetDirectory() const {
+  FileSpec directory{*m_opaque_ap};
+  directory.GetFilename().Clear();
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log) {
+    if (directory)
+      log->Printf("SBFileSpec(%p)::GetDirectory () => \"%s\"",
+                  static_cast<void *>(m_opaque_ap.get()),
+                  directory.GetCString());
     else
-        m_opaque_ap->GetDirectory().Clear();
+      log->Printf("SBFileSpec(%p)::GetDirectory () => NULL",
+                  static_cast<void *>(m_opaque_ap.get()));
+  }
+  return directory.GetCString();
 }
 
-uint32_t
-SBFileSpec::GetPath (char *dst_path, size_t dst_len) const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+void SBFileSpec::SetFilename(const char *filename) {
+  if (filename && filename[0])
+    m_opaque_ap->GetFilename().SetCString(filename);
+  else
+    m_opaque_ap->GetFilename().Clear();
+}
 
-    uint32_t result = m_opaque_ap->GetPath (dst_path, dst_len);
+void SBFileSpec::SetDirectory(const char *directory) {
+  if (directory && directory[0])
+    m_opaque_ap->GetDirectory().SetCString(directory);
+  else
+    m_opaque_ap->GetDirectory().Clear();
+}
 
-    if (log)
-        log->Printf ("SBFileSpec(%p)::GetPath (dst_path=\"%.*s\", dst_len=%" PRIu64 ") => %u",
-                     static_cast<void*>(m_opaque_ap.get()), result, dst_path,
-                     static_cast<uint64_t>(dst_len), result);
+uint32_t SBFileSpec::GetPath(char *dst_path, size_t dst_len) const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-    if (result == 0 && dst_path && dst_len > 0)
-        *dst_path = '\0';
-    return result;
-}
+  uint32_t result = m_opaque_ap->GetPath(dst_path, dst_len);
 
+  if (log)
+    log->Printf("SBFileSpec(%p)::GetPath (dst_path=\"%.*s\", dst_len=%" PRIu64
+                ") => %u",
+                static_cast<void *>(m_opaque_ap.get()), result, dst_path,
+                static_cast<uint64_t>(dst_len), result);
 
-const lldb_private::FileSpec *
-SBFileSpec::operator->() const
-{
-    return m_opaque_ap.get();
+  if (result == 0 && dst_path && dst_len > 0)
+    *dst_path = '\0';
+  return result;
 }
 
-const lldb_private::FileSpec *
-SBFileSpec::get() const
-{
-    return m_opaque_ap.get();
+const lldb_private::FileSpec *SBFileSpec::operator->() const {
+  return m_opaque_ap.get();
 }
 
-
-const lldb_private::FileSpec &
-SBFileSpec::operator*() const
-{
-    return *m_opaque_ap.get();
+const lldb_private::FileSpec *SBFileSpec::get() const {
+  return m_opaque_ap.get();
 }
 
-const lldb_private::FileSpec &
-SBFileSpec::ref() const
-{
-    return *m_opaque_ap.get();
+const lldb_private::FileSpec &SBFileSpec::operator*() const {
+  return *m_opaque_ap.get();
 }
 
+const lldb_private::FileSpec &SBFileSpec::ref() const {
+  return *m_opaque_ap.get();
+}
 
-void
-SBFileSpec::SetFileSpec (const lldb_private::FileSpec& fs)
-{
-    *m_opaque_ap = fs;
+void SBFileSpec::SetFileSpec(const lldb_private::FileSpec &fs) {
+  *m_opaque_ap = fs;
 }
 
-bool
-SBFileSpec::GetDescription (SBStream &description) const
-{
-    Stream &strm = description.ref();
-    char path[PATH_MAX];
-    if (m_opaque_ap->GetPath(path, sizeof(path)))
-        strm.PutCString (path);    
-    return true;
+bool SBFileSpec::GetDescription(SBStream &description) const {
+  Stream &strm = description.ref();
+  char path[PATH_MAX];
+  if (m_opaque_ap->GetPath(path, sizeof(path)))
+    strm.PutCString(path);
+  return true;
 }
 
-void
-SBFileSpec::AppendPathComponent (const char *fn)
-{
-    m_opaque_ap->AppendPathComponent (fn);
+void SBFileSpec::AppendPathComponent(const char *fn) {
+  m_opaque_ap->AppendPathComponent(fn);
 }

Modified: lldb/trunk/source/API/SBFileSpecList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFileSpecList.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFileSpecList.cpp (original)
+++ lldb/trunk/source/API/SBFileSpecList.cpp Tue Sep  6 15:57:50 2016
@@ -1,4 +1,5 @@
-//===-- SBFileSpecListList.cpp ------------------------------------------*- C++ -*-===//
+//===-- SBFileSpecListList.cpp ------------------------------------------*- C++
+//-*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -20,124 +21,83 @@
 using namespace lldb;
 using namespace lldb_private;
 
+SBFileSpecList::SBFileSpecList() : m_opaque_ap(new FileSpecList()) {}
 
+SBFileSpecList::SBFileSpecList(const SBFileSpecList &rhs) : m_opaque_ap() {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-SBFileSpecList::SBFileSpecList () :
-    m_opaque_ap(new FileSpecList())
-{
-}
-
-SBFileSpecList::SBFileSpecList (const SBFileSpecList &rhs) :
-    m_opaque_ap()
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (rhs.m_opaque_ap.get())
-        m_opaque_ap.reset (new FileSpecList (*(rhs.get())));
-
-    if (log)
-    {
-        log->Printf ("SBFileSpecList::SBFileSpecList (const SBFileSpecList rhs.ap=%p) => SBFileSpecList(%p)",
-                     static_cast<void*>(rhs.m_opaque_ap.get()),
-                     static_cast<void*>(m_opaque_ap.get()));
-    }
-}
+  if (rhs.m_opaque_ap.get())
+    m_opaque_ap.reset(new FileSpecList(*(rhs.get())));
 
-SBFileSpecList::~SBFileSpecList ()
-{
+  if (log) {
+    log->Printf("SBFileSpecList::SBFileSpecList (const SBFileSpecList "
+                "rhs.ap=%p) => SBFileSpecList(%p)",
+                static_cast<void *>(rhs.m_opaque_ap.get()),
+                static_cast<void *>(m_opaque_ap.get()));
+  }
 }
 
-const SBFileSpecList &
-SBFileSpecList::operator = (const SBFileSpecList &rhs)
-{
-    if (this != &rhs)
-    {
-        m_opaque_ap.reset (new lldb_private::FileSpecList(*(rhs.get())));
-    }
-    return *this;
-}
+SBFileSpecList::~SBFileSpecList() {}
 
-uint32_t
-SBFileSpecList::GetSize () const
-{
-    return m_opaque_ap->GetSize();
+const SBFileSpecList &SBFileSpecList::operator=(const SBFileSpecList &rhs) {
+  if (this != &rhs) {
+    m_opaque_ap.reset(new lldb_private::FileSpecList(*(rhs.get())));
+  }
+  return *this;
 }
 
-void
-SBFileSpecList::Append (const SBFileSpec &sb_file)
-{
-    m_opaque_ap->Append (sb_file.ref());
-}
+uint32_t SBFileSpecList::GetSize() const { return m_opaque_ap->GetSize(); }
 
-bool
-SBFileSpecList::AppendIfUnique (const SBFileSpec &sb_file)
-{
-    return m_opaque_ap->AppendIfUnique (sb_file.ref());
+void SBFileSpecList::Append(const SBFileSpec &sb_file) {
+  m_opaque_ap->Append(sb_file.ref());
 }
 
-void
-SBFileSpecList::Clear()
-{
-    m_opaque_ap->Clear();
+bool SBFileSpecList::AppendIfUnique(const SBFileSpec &sb_file) {
+  return m_opaque_ap->AppendIfUnique(sb_file.ref());
 }
 
-uint32_t
-SBFileSpecList::FindFileIndex (uint32_t idx, const SBFileSpec &sb_file, bool full)
-{
-    return m_opaque_ap->FindFileIndex (idx, sb_file.ref(), full);
-}
+void SBFileSpecList::Clear() { m_opaque_ap->Clear(); }
 
-const SBFileSpec
-SBFileSpecList::GetFileSpecAtIndex (uint32_t idx) const
-{
-    SBFileSpec new_spec;
-    new_spec.SetFileSpec(m_opaque_ap->GetFileSpecAtIndex(idx));
-    return new_spec;
+uint32_t SBFileSpecList::FindFileIndex(uint32_t idx, const SBFileSpec &sb_file,
+                                       bool full) {
+  return m_opaque_ap->FindFileIndex(idx, sb_file.ref(), full);
 }
 
-const lldb_private::FileSpecList *
-SBFileSpecList::operator->() const
-{
-    return m_opaque_ap.get();
+const SBFileSpec SBFileSpecList::GetFileSpecAtIndex(uint32_t idx) const {
+  SBFileSpec new_spec;
+  new_spec.SetFileSpec(m_opaque_ap->GetFileSpecAtIndex(idx));
+  return new_spec;
 }
 
-const lldb_private::FileSpecList *
-SBFileSpecList::get() const
-{
-    return m_opaque_ap.get();
+const lldb_private::FileSpecList *SBFileSpecList::operator->() const {
+  return m_opaque_ap.get();
 }
 
+const lldb_private::FileSpecList *SBFileSpecList::get() const {
+  return m_opaque_ap.get();
+}
 
-const lldb_private::FileSpecList &
-SBFileSpecList::operator*() const
-{
-    return *m_opaque_ap.get();
+const lldb_private::FileSpecList &SBFileSpecList::operator*() const {
+  return *m_opaque_ap.get();
 }
 
-const lldb_private::FileSpecList &
-SBFileSpecList::ref() const
-{
-    return *m_opaque_ap.get();
+const lldb_private::FileSpecList &SBFileSpecList::ref() const {
+  return *m_opaque_ap.get();
 }
 
-bool
-SBFileSpecList::GetDescription (SBStream &description) const
-{
-    Stream &strm = description.ref();
+bool SBFileSpecList::GetDescription(SBStream &description) const {
+  Stream &strm = description.ref();
 
-    if (m_opaque_ap.get())
-    {
-        uint32_t num_files = m_opaque_ap->GetSize();
-        strm.Printf ("%d files: ", num_files);
-        for (uint32_t i = 0; i < num_files; i++)
-        {
-            char path[PATH_MAX];
-            if (m_opaque_ap->GetFileSpecAtIndex(i).GetPath(path, sizeof(path)))
-                strm.Printf ("\n    %s", path);
-        }
+  if (m_opaque_ap.get()) {
+    uint32_t num_files = m_opaque_ap->GetSize();
+    strm.Printf("%d files: ", num_files);
+    for (uint32_t i = 0; i < num_files; i++) {
+      char path[PATH_MAX];
+      if (m_opaque_ap->GetFileSpecAtIndex(i).GetPath(path, sizeof(path)))
+        strm.Printf("\n    %s", path);
     }
-    else
-        strm.PutCString ("No value");
-    
-    return true;
+  } else
+    strm.PutCString("No value");
+
+  return true;
 }

Modified: lldb/trunk/source/API/SBFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFrame.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFrame.cpp (original)
+++ lldb/trunk/source/API/SBFrame.cpp Tue Sep  6 15:57:50 2016
@@ -19,6 +19,7 @@
 
 #include "lldb/lldb-types.h"
 
+#include "Plugins/ExpressionParser/Clang/ClangPersistentVariables.h"
 #include "lldb/Core/Address.h"
 #include "lldb/Core/ConstString.h"
 #include "lldb/Core/Log.h"
@@ -26,1116 +27,911 @@
 #include "lldb/Core/StreamFile.h"
 #include "lldb/Core/ValueObjectRegister.h"
 #include "lldb/Core/ValueObjectVariable.h"
-#include "Plugins/ExpressionParser/Clang/ClangPersistentVariables.h"
 #include "lldb/Expression/UserExpression.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Symbol/Block.h"
 #include "lldb/Symbol/Function.h"
 #include "lldb/Symbol/Symbol.h"
 #include "lldb/Symbol/SymbolContext.h"
-#include "lldb/Symbol/VariableList.h"
 #include "lldb/Symbol/Variable.h"
+#include "lldb/Symbol/VariableList.h"
 #include "lldb/Target/ExecutionContext.h"
-#include "lldb/Target/Target.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/RegisterContext.h"
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/StackID.h"
+#include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 
-#include "lldb/API/SBDebugger.h"
-#include "lldb/API/SBValue.h"
 #include "lldb/API/SBAddress.h"
+#include "lldb/API/SBDebugger.h"
 #include "lldb/API/SBExpressionOptions.h"
 #include "lldb/API/SBStream.h"
 #include "lldb/API/SBSymbolContext.h"
 #include "lldb/API/SBThread.h"
+#include "lldb/API/SBValue.h"
 #include "lldb/API/SBVariablesOptions.h"
 
 using namespace lldb;
 using namespace lldb_private;
 
-SBFrame::SBFrame () :
-    m_opaque_sp (new ExecutionContextRef())
-{
-}
-
-SBFrame::SBFrame (const StackFrameSP &lldb_object_sp) :
-    m_opaque_sp (new ExecutionContextRef (lldb_object_sp))
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+SBFrame::SBFrame() : m_opaque_sp(new ExecutionContextRef()) {}
 
-    if (log)
-    {
-        SBStream sstr;
-        GetDescription (sstr);
-        log->Printf ("SBFrame::SBFrame (sp=%p) => SBFrame(%p): %s",
-                     static_cast<void*>(lldb_object_sp.get()),
-                     static_cast<void*>(lldb_object_sp.get()), sstr.GetData());
-    }
+SBFrame::SBFrame(const StackFrameSP &lldb_object_sp)
+    : m_opaque_sp(new ExecutionContextRef(lldb_object_sp)) {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (log) {
+    SBStream sstr;
+    GetDescription(sstr);
+    log->Printf("SBFrame::SBFrame (sp=%p) => SBFrame(%p): %s",
+                static_cast<void *>(lldb_object_sp.get()),
+                static_cast<void *>(lldb_object_sp.get()), sstr.GetData());
+  }
 }
 
-SBFrame::SBFrame(const SBFrame &rhs) :
-    m_opaque_sp (new ExecutionContextRef (*rhs.m_opaque_sp))
-{
-}
+SBFrame::SBFrame(const SBFrame &rhs)
+    : m_opaque_sp(new ExecutionContextRef(*rhs.m_opaque_sp)) {}
 
 SBFrame::~SBFrame() = default;
 
-const SBFrame &
-SBFrame::operator = (const SBFrame &rhs)
-{
-    if (this != &rhs)
-        *m_opaque_sp = *rhs.m_opaque_sp;
-    return *this;
-}
-
-StackFrameSP
-SBFrame::GetFrameSP() const
-{
-    return (m_opaque_sp ? m_opaque_sp->GetFrameSP() : StackFrameSP());
-}
-
-void
-SBFrame::SetFrameSP (const StackFrameSP &lldb_object_sp)
-{
-    return m_opaque_sp->SetFrameSP(lldb_object_sp);
-}
-
-bool
-SBFrame::IsValid() const
-{
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        return GetFrameSP().get() != nullptr;
-    }
-    
-    // Without a target & process we can't have a valid stack frame.
-    return false;
-}
-
-SBSymbolContext
-SBFrame::GetSymbolContext (uint32_t resolve_scope) const
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    SBSymbolContext sb_sym_ctx;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                sb_sym_ctx.SetSymbolContext(&frame->GetSymbolContext (resolve_scope));
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::GetVariables () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::GetSymbolContext () => error: process is running");
-        }
-    }
-
-    if (log)
-        log->Printf ("SBFrame(%p)::GetSymbolContext (resolve_scope=0x%8.8x) => SBSymbolContext(%p)",
-                     static_cast<void*>(frame), resolve_scope,
-                     static_cast<void*>(sb_sym_ctx.get()));
-
-    return sb_sym_ctx;
-}
-
-SBModule
-SBFrame::GetModule () const
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    SBModule sb_module;
-    ModuleSP module_sp;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                module_sp = frame->GetSymbolContext (eSymbolContextModule).module_sp;
-                sb_module.SetSP (module_sp);
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::GetModule () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::GetModule () => error: process is running");
-        }
-    }
-
-    if (log)
-        log->Printf ("SBFrame(%p)::GetModule () => SBModule(%p)",
-                     static_cast<void*>(frame),
-                     static_cast<void*>(module_sp.get()));
-
-    return sb_module;
-}
-
-SBCompileUnit
-SBFrame::GetCompileUnit () const
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    SBCompileUnit sb_comp_unit;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                sb_comp_unit.reset (frame->GetSymbolContext (eSymbolContextCompUnit).comp_unit);
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::GetCompileUnit () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::GetCompileUnit () => error: process is running");
-        }
-    }
-    if (log)
-        log->Printf ("SBFrame(%p)::GetCompileUnit () => SBCompileUnit(%p)",
-                     static_cast<void*>(frame),
-                     static_cast<void*>(sb_comp_unit.get()));
-
-    return sb_comp_unit;
-}
-
-SBFunction
-SBFrame::GetFunction () const
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    SBFunction sb_function;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                sb_function.reset(frame->GetSymbolContext (eSymbolContextFunction).function);
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::GetFunction () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::GetFunction () => error: process is running");
-        }
-    }
-    if (log)
-        log->Printf ("SBFrame(%p)::GetFunction () => SBFunction(%p)",
-                     static_cast<void*>(frame),
-                     static_cast<void*>(sb_function.get()));
-
-    return sb_function;
-}
-
-SBSymbol
-SBFrame::GetSymbol () const
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    SBSymbol sb_symbol;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                sb_symbol.reset(frame->GetSymbolContext (eSymbolContextSymbol).symbol);
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::GetSymbol () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::GetSymbol () => error: process is running");
-        }
-    }
-    if (log)
-        log->Printf ("SBFrame(%p)::GetSymbol () => SBSymbol(%p)",
-                     static_cast<void*>(frame),
-                     static_cast<void*>(sb_symbol.get()));
-    return sb_symbol;
-}
-
-SBBlock
-SBFrame::GetBlock () const
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    SBBlock sb_block;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                sb_block.SetPtr (frame->GetSymbolContext (eSymbolContextBlock).block);
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::GetBlock () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame(%p)::GetBlock () => error: process is running",
-                             static_cast<void*>(frame));
-        }
-    }
-    if (log)
-        log->Printf ("SBFrame(%p)::GetBlock () => SBBlock(%p)",
-                     static_cast<void*>(frame),
-                     static_cast<void*>(sb_block.GetPtr()));
-    return sb_block;
-}
-
-SBBlock
-SBFrame::GetFrameBlock () const
-{
-    SBBlock sb_block;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                sb_block.SetPtr(frame->GetFrameBlock ());
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::GetFrameBlock () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::GetFrameBlock () => error: process is running");
-        }
-    }
-    if (log)
-        log->Printf ("SBFrame(%p)::GetFrameBlock () => SBBlock(%p)",
-                     static_cast<void*>(frame),
-                     static_cast<void*>(sb_block.GetPtr()));
-    return sb_block;    
-}
-
-SBLineEntry
-SBFrame::GetLineEntry () const
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    SBLineEntry sb_line_entry;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                sb_line_entry.SetLineEntry (frame->GetSymbolContext (eSymbolContextLineEntry).line_entry);
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::GetLineEntry () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::GetLineEntry () => error: process is running");
-        }
-    }
-    if (log)
-        log->Printf ("SBFrame(%p)::GetLineEntry () => SBLineEntry(%p)",
-                     static_cast<void*>(frame),
-                     static_cast<void*>(sb_line_entry.get()));
-    return sb_line_entry;
-}
-
-uint32_t
-SBFrame::GetFrameID () const
-{
-    uint32_t frame_idx = UINT32_MAX;
-
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = exe_ctx.GetFramePtr();
-    if (frame)
-        frame_idx = frame->GetFrameIndex ();
-
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-        log->Printf ("SBFrame(%p)::GetFrameID () => %u",
-                     static_cast<void*>(frame), frame_idx);
-    return frame_idx;
-}
-
-lldb::addr_t
-SBFrame::GetCFA () const
-{
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = exe_ctx.GetFramePtr();
-    if (frame)
-        return frame->GetStackID().GetCallFrameAddress();
-    return LLDB_INVALID_ADDRESS;
-}
-
-addr_t
-SBFrame::GetPC () const
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    addr_t addr = LLDB_INVALID_ADDRESS;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                addr = frame->GetFrameCodeAddress().GetOpcodeLoadAddress (target, eAddressClassCode);
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::GetPC () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::GetPC () => error: process is running");
-        }
-    }
-
-    if (log)
-        log->Printf ("SBFrame(%p)::GetPC () => 0x%" PRIx64,
-                     static_cast<void*>(frame), addr);
-
-    return addr;
-}
-
-bool
-SBFrame::SetPC (addr_t new_pc)
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    bool ret_val = false;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                ret_val = frame->GetRegisterContext()->SetPC (new_pc);
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::SetPC () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::SetPC () => error: process is running");
-        }
-    }
-
-    if (log)
-        log->Printf ("SBFrame(%p)::SetPC (new_pc=0x%" PRIx64 ") => %i",
-                     static_cast<void*>(frame), new_pc, ret_val);
-
-    return ret_val;
-}
-
-addr_t
-SBFrame::GetSP () const
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    addr_t addr = LLDB_INVALID_ADDRESS;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                addr = frame->GetRegisterContext()->GetSP();
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::GetSP () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::GetSP () => error: process is running");
-        }
-    }
-    if (log)
-        log->Printf ("SBFrame(%p)::GetSP () => 0x%" PRIx64,
-                     static_cast<void*>(frame), addr);
-
-    return addr;
-}
-
-addr_t
-SBFrame::GetFP () const
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    addr_t addr = LLDB_INVALID_ADDRESS;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                addr = frame->GetRegisterContext()->GetFP();
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::GetFP () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::GetFP () => error: process is running");
-        }
-    }
-
-    if (log)
-        log->Printf ("SBFrame(%p)::GetFP () => 0x%" PRIx64,
-                     static_cast<void*>(frame), addr);
-    return addr;
-}
-
-SBAddress
-SBFrame::GetPCAddress () const
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    SBAddress sb_addr;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = exe_ctx.GetFramePtr();
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                sb_addr.SetAddress (&frame->GetFrameCodeAddress());
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::GetPCAddress () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::GetPCAddress () => error: process is running");
-        }
-    }
+const SBFrame &SBFrame::operator=(const SBFrame &rhs) {
+  if (this != &rhs)
+    *m_opaque_sp = *rhs.m_opaque_sp;
+  return *this;
+}
+
+StackFrameSP SBFrame::GetFrameSP() const {
+  return (m_opaque_sp ? m_opaque_sp->GetFrameSP() : StackFrameSP());
+}
+
+void SBFrame::SetFrameSP(const StackFrameSP &lldb_object_sp) {
+  return m_opaque_sp->SetFrameSP(lldb_object_sp);
+}
+
+bool SBFrame::IsValid() const {
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock()))
+      return GetFrameSP().get() != nullptr;
+  }
+
+  // Without a target & process we can't have a valid stack frame.
+  return false;
+}
+
+SBSymbolContext SBFrame::GetSymbolContext(uint32_t resolve_scope) const {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  SBSymbolContext sb_sym_ctx;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        sb_sym_ctx.SetSymbolContext(&frame->GetSymbolContext(resolve_scope));
+      } else {
+        if (log)
+          log->Printf("SBFrame::GetVariables () => error: could not "
+                      "reconstruct frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf(
+            "SBFrame::GetSymbolContext () => error: process is running");
+    }
+  }
+
+  if (log)
+    log->Printf("SBFrame(%p)::GetSymbolContext (resolve_scope=0x%8.8x) => "
+                "SBSymbolContext(%p)",
+                static_cast<void *>(frame), resolve_scope,
+                static_cast<void *>(sb_sym_ctx.get()));
+
+  return sb_sym_ctx;
+}
+
+SBModule SBFrame::GetModule() const {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  SBModule sb_module;
+  ModuleSP module_sp;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        module_sp = frame->GetSymbolContext(eSymbolContextModule).module_sp;
+        sb_module.SetSP(module_sp);
+      } else {
+        if (log)
+          log->Printf("SBFrame::GetModule () => error: could not reconstruct "
+                      "frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::GetModule () => error: process is running");
+    }
+  }
+
+  if (log)
+    log->Printf("SBFrame(%p)::GetModule () => SBModule(%p)",
+                static_cast<void *>(frame),
+                static_cast<void *>(module_sp.get()));
+
+  return sb_module;
+}
+
+SBCompileUnit SBFrame::GetCompileUnit() const {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  SBCompileUnit sb_comp_unit;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        sb_comp_unit.reset(
+            frame->GetSymbolContext(eSymbolContextCompUnit).comp_unit);
+      } else {
+        if (log)
+          log->Printf("SBFrame::GetCompileUnit () => error: could not "
+                      "reconstruct frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::GetCompileUnit () => error: process is running");
+    }
+  }
+  if (log)
+    log->Printf("SBFrame(%p)::GetCompileUnit () => SBCompileUnit(%p)",
+                static_cast<void *>(frame),
+                static_cast<void *>(sb_comp_unit.get()));
+
+  return sb_comp_unit;
+}
+
+SBFunction SBFrame::GetFunction() const {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  SBFunction sb_function;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        sb_function.reset(
+            frame->GetSymbolContext(eSymbolContextFunction).function);
+      } else {
+        if (log)
+          log->Printf("SBFrame::GetFunction () => error: could not reconstruct "
+                      "frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::GetFunction () => error: process is running");
+    }
+  }
+  if (log)
+    log->Printf("SBFrame(%p)::GetFunction () => SBFunction(%p)",
+                static_cast<void *>(frame),
+                static_cast<void *>(sb_function.get()));
+
+  return sb_function;
+}
+
+SBSymbol SBFrame::GetSymbol() const {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  SBSymbol sb_symbol;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        sb_symbol.reset(frame->GetSymbolContext(eSymbolContextSymbol).symbol);
+      } else {
+        if (log)
+          log->Printf("SBFrame::GetSymbol () => error: could not reconstruct "
+                      "frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::GetSymbol () => error: process is running");
+    }
+  }
+  if (log)
+    log->Printf("SBFrame(%p)::GetSymbol () => SBSymbol(%p)",
+                static_cast<void *>(frame),
+                static_cast<void *>(sb_symbol.get()));
+  return sb_symbol;
+}
+
+SBBlock SBFrame::GetBlock() const {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  SBBlock sb_block;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        sb_block.SetPtr(frame->GetSymbolContext(eSymbolContextBlock).block);
+      } else {
+        if (log)
+          log->Printf("SBFrame::GetBlock () => error: could not reconstruct "
+                      "frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame(%p)::GetBlock () => error: process is running",
+                    static_cast<void *>(frame));
+    }
+  }
+  if (log)
+    log->Printf("SBFrame(%p)::GetBlock () => SBBlock(%p)",
+                static_cast<void *>(frame),
+                static_cast<void *>(sb_block.GetPtr()));
+  return sb_block;
+}
+
+SBBlock SBFrame::GetFrameBlock() const {
+  SBBlock sb_block;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        sb_block.SetPtr(frame->GetFrameBlock());
+      } else {
+        if (log)
+          log->Printf("SBFrame::GetFrameBlock () => error: could not "
+                      "reconstruct frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::GetFrameBlock () => error: process is running");
+    }
+  }
+  if (log)
+    log->Printf("SBFrame(%p)::GetFrameBlock () => SBBlock(%p)",
+                static_cast<void *>(frame),
+                static_cast<void *>(sb_block.GetPtr()));
+  return sb_block;
+}
+
+SBLineEntry SBFrame::GetLineEntry() const {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  SBLineEntry sb_line_entry;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        sb_line_entry.SetLineEntry(
+            frame->GetSymbolContext(eSymbolContextLineEntry).line_entry);
+      } else {
+        if (log)
+          log->Printf("SBFrame::GetLineEntry () => error: could not "
+                      "reconstruct frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::GetLineEntry () => error: process is running");
+    }
+  }
+  if (log)
+    log->Printf("SBFrame(%p)::GetLineEntry () => SBLineEntry(%p)",
+                static_cast<void *>(frame),
+                static_cast<void *>(sb_line_entry.get()));
+  return sb_line_entry;
+}
+
+uint32_t SBFrame::GetFrameID() const {
+  uint32_t frame_idx = UINT32_MAX;
+
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = exe_ctx.GetFramePtr();
+  if (frame)
+    frame_idx = frame->GetFrameIndex();
+
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log)
+    log->Printf("SBFrame(%p)::GetFrameID () => %u", static_cast<void *>(frame),
+                frame_idx);
+  return frame_idx;
+}
+
+lldb::addr_t SBFrame::GetCFA() const {
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = exe_ctx.GetFramePtr();
+  if (frame)
+    return frame->GetStackID().GetCallFrameAddress();
+  return LLDB_INVALID_ADDRESS;
+}
+
+addr_t SBFrame::GetPC() const {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  addr_t addr = LLDB_INVALID_ADDRESS;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        addr = frame->GetFrameCodeAddress().GetOpcodeLoadAddress(
+            target, eAddressClassCode);
+      } else {
+        if (log)
+          log->Printf("SBFrame::GetPC () => error: could not reconstruct frame "
+                      "object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::GetPC () => error: process is running");
+    }
+  }
+
+  if (log)
+    log->Printf("SBFrame(%p)::GetPC () => 0x%" PRIx64,
+                static_cast<void *>(frame), addr);
+
+  return addr;
+}
+
+bool SBFrame::SetPC(addr_t new_pc) {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  bool ret_val = false;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        ret_val = frame->GetRegisterContext()->SetPC(new_pc);
+      } else {
+        if (log)
+          log->Printf("SBFrame::SetPC () => error: could not reconstruct frame "
+                      "object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::SetPC () => error: process is running");
+    }
+  }
+
+  if (log)
+    log->Printf("SBFrame(%p)::SetPC (new_pc=0x%" PRIx64 ") => %i",
+                static_cast<void *>(frame), new_pc, ret_val);
+
+  return ret_val;
+}
+
+addr_t SBFrame::GetSP() const {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  addr_t addr = LLDB_INVALID_ADDRESS;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        addr = frame->GetRegisterContext()->GetSP();
+      } else {
+        if (log)
+          log->Printf("SBFrame::GetSP () => error: could not reconstruct frame "
+                      "object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::GetSP () => error: process is running");
+    }
+  }
+  if (log)
+    log->Printf("SBFrame(%p)::GetSP () => 0x%" PRIx64,
+                static_cast<void *>(frame), addr);
+
+  return addr;
+}
+
+addr_t SBFrame::GetFP() const {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  addr_t addr = LLDB_INVALID_ADDRESS;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        addr = frame->GetRegisterContext()->GetFP();
+      } else {
+        if (log)
+          log->Printf("SBFrame::GetFP () => error: could not reconstruct frame "
+                      "object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::GetFP () => error: process is running");
+    }
+  }
+
+  if (log)
+    log->Printf("SBFrame(%p)::GetFP () => 0x%" PRIx64,
+                static_cast<void *>(frame), addr);
+  return addr;
+}
+
+SBAddress SBFrame::GetPCAddress() const {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  SBAddress sb_addr;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = exe_ctx.GetFramePtr();
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        sb_addr.SetAddress(&frame->GetFrameCodeAddress());
+      } else {
+        if (log)
+          log->Printf("SBFrame::GetPCAddress () => error: could not "
+                      "reconstruct frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::GetPCAddress () => error: process is running");
+    }
+  }
+  if (log)
+    log->Printf("SBFrame(%p)::GetPCAddress () => SBAddress(%p)",
+                static_cast<void *>(frame), static_cast<void *>(sb_addr.get()));
+  return sb_addr;
+}
+
+void SBFrame::Clear() { m_opaque_sp->Clear(); }
+
+lldb::SBValue SBFrame::GetValueForVariablePath(const char *var_path) {
+  SBValue sb_value;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = exe_ctx.GetFramePtr();
+  Target *target = exe_ctx.GetTargetPtr();
+  if (frame && target) {
+    lldb::DynamicValueType use_dynamic =
+        frame->CalculateTarget()->GetPreferDynamicValue();
+    sb_value = GetValueForVariablePath(var_path, use_dynamic);
+  }
+  return sb_value;
+}
+
+lldb::SBValue SBFrame::GetValueForVariablePath(const char *var_path,
+                                               DynamicValueType use_dynamic) {
+  SBValue sb_value;
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (var_path == nullptr || var_path[0] == '\0') {
     if (log)
-        log->Printf ("SBFrame(%p)::GetPCAddress () => SBAddress(%p)",
-                     static_cast<void*>(frame),
-                     static_cast<void*>(sb_addr.get()));
-    return sb_addr;
-}
-
-void
-SBFrame::Clear()
-{
-    m_opaque_sp->Clear();
-}
-
-lldb::SBValue
-SBFrame::GetValueForVariablePath (const char *var_path)
-{
-    SBValue sb_value;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = exe_ctx.GetFramePtr();
-    Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
-    {
-        lldb::DynamicValueType  use_dynamic = frame->CalculateTarget()->GetPreferDynamicValue();
-        sb_value = GetValueForVariablePath (var_path, use_dynamic);
-    }
+      log->Printf(
+          "SBFrame::GetValueForVariablePath called with empty variable path.");
     return sb_value;
-}
+  }
 
-lldb::SBValue
-SBFrame::GetValueForVariablePath (const char *var_path, DynamicValueType use_dynamic)
-{
-    SBValue sb_value;
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (var_path == nullptr || var_path[0] == '\0')
-    {
-        if (log)
-            log->Printf ("SBFrame::GetValueForVariablePath called with empty variable path.");
-        return sb_value;
-    }
-
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                VariableSP var_sp;
-                Error error;
-                ValueObjectSP value_sp (frame->GetValueForVariableExpressionPath (var_path,
-                                                                                  eNoDynamicValues,
-                                                                                  StackFrame::eExpressionPathOptionCheckPtrVsMember | StackFrame::eExpressionPathOptionsAllowDirectIVarAccess,
-                                                                                  var_sp,
-                                                                                  error));
-                sb_value.SetSP(value_sp, use_dynamic);
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::GetValueForVariablePath () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::GetValueForVariablePath () => error: process is running");
-        }
-    }
-    return sb_value;
-}
-
-SBValue
-SBFrame::FindVariable (const char *name)
-{
-    SBValue value;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = exe_ctx.GetFramePtr();
-    Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
-    {
-        lldb::DynamicValueType  use_dynamic = frame->CalculateTarget()->GetPreferDynamicValue();
-        value = FindVariable (name, use_dynamic);
-    }
-    return value;
-}
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
 
-SBValue
-SBFrame::FindVariable (const char *name, lldb::DynamicValueType use_dynamic)
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    VariableSP var_sp;
-    SBValue sb_value;
-
-    if (name == nullptr || name[0] == '\0')
-    {
-        if (log)
-            log->Printf ("SBFrame::FindVariable called with empty name");
-        return sb_value;
-    }
-
-    ValueObjectSP value_sp;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                VariableList variable_list;
-                SymbolContext sc (frame->GetSymbolContext (eSymbolContextBlock));
-
-                if (sc.block)
-                {
-                    const bool can_create = true;
-                    const bool get_parent_variables = true;
-                    const bool stop_if_block_is_inlined_function = true;
-
-                    if (sc.block->AppendVariables (can_create,
-                                                   get_parent_variables,
-                                                   stop_if_block_is_inlined_function,
-                                                   [frame](Variable* v) { return v->IsInScope(frame); },
-                                                   &variable_list))
-                    {
-                        var_sp = variable_list.FindVariable (ConstString(name));
-                    }
-                }
-
-                if (var_sp)
-                {
-                    value_sp = frame->GetValueObjectForFrameVariable(var_sp, eNoDynamicValues);
-                    sb_value.SetSP(value_sp, use_dynamic);
-                }
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::FindVariable () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::FindVariable () => error: process is running");
-        }
-    }
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        VariableSP var_sp;
+        Error error;
+        ValueObjectSP value_sp(frame->GetValueForVariableExpressionPath(
+            var_path, eNoDynamicValues,
+            StackFrame::eExpressionPathOptionCheckPtrVsMember |
+                StackFrame::eExpressionPathOptionsAllowDirectIVarAccess,
+            var_sp, error));
+        sb_value.SetSP(value_sp, use_dynamic);
+      } else {
+        if (log)
+          log->Printf("SBFrame::GetValueForVariablePath () => error: could not "
+                      "reconstruct frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf(
+            "SBFrame::GetValueForVariablePath () => error: process is running");
+    }
+  }
+  return sb_value;
+}
+
+SBValue SBFrame::FindVariable(const char *name) {
+  SBValue value;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = exe_ctx.GetFramePtr();
+  Target *target = exe_ctx.GetTargetPtr();
+  if (frame && target) {
+    lldb::DynamicValueType use_dynamic =
+        frame->CalculateTarget()->GetPreferDynamicValue();
+    value = FindVariable(name, use_dynamic);
+  }
+  return value;
+}
+
+SBValue SBFrame::FindVariable(const char *name,
+                              lldb::DynamicValueType use_dynamic) {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  VariableSP var_sp;
+  SBValue sb_value;
 
+  if (name == nullptr || name[0] == '\0') {
     if (log)
-        log->Printf ("SBFrame(%p)::FindVariable (name=\"%s\") => SBValue(%p)",
-                     static_cast<void*>(frame), name,
-                     static_cast<void*>(value_sp.get()));
-
+      log->Printf("SBFrame::FindVariable called with empty name");
     return sb_value;
-}
-
-SBValue
-SBFrame::FindValue (const char *name, ValueType value_type)
-{
-    SBValue value;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = exe_ctx.GetFramePtr();
-    Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
-    {
-        lldb::DynamicValueType use_dynamic = frame->CalculateTarget()->GetPreferDynamicValue();
-        value = FindValue (name, value_type, use_dynamic);
-    }
-    return value;
-}
+  }
 
-SBValue
-SBFrame::FindValue (const char *name, ValueType value_type, lldb::DynamicValueType use_dynamic)
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    SBValue sb_value;
-
-    if (name == nullptr || name[0] == '\0')
-    {
-        if (log)
-            log->Printf ("SBFrame::FindValue called with empty name.");
-        return sb_value;
-    }
-
-    ValueObjectSP value_sp;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                VariableList variable_list;
-
-                switch (value_type)
-                {
-                case eValueTypeVariableGlobal:      // global variable
-                case eValueTypeVariableStatic:      // static variable
-                case eValueTypeVariableArgument:    // function argument variables
-                case eValueTypeVariableLocal:       // function local variables
-                case eValueTypeVariableThreadLocal: // thread local variables
-                {
-                    SymbolContext sc(frame->GetSymbolContext(eSymbolContextBlock));
-
-                    const bool can_create = true;
-                    const bool get_parent_variables = true;
-                    const bool stop_if_block_is_inlined_function = true;
-
-                    if (sc.block)
-                        sc.block->AppendVariables(can_create, get_parent_variables, stop_if_block_is_inlined_function,
-                                                  [frame](Variable *v) { return v->IsInScope(frame); }, &variable_list);
-                    if (value_type == eValueTypeVariableGlobal)
-                    {
-                        const bool get_file_globals = true;
-                        VariableList *frame_vars = frame->GetVariableList(get_file_globals);
-                        if (frame_vars)
-                            frame_vars->AppendVariablesIfUnique(variable_list);
-                    }
-                    ConstString const_name(name);
-                    VariableSP variable_sp(variable_list.FindVariable(const_name, value_type));
-                    if (variable_sp)
-                    {
-                        value_sp = frame->GetValueObjectForFrameVariable(variable_sp, eNoDynamicValues);
-                        sb_value.SetSP(value_sp, use_dynamic);
-                    }
-                    }
-                    break;
-
-                case eValueTypeRegister:            // stack frame register value
-                    {
-                        RegisterContextSP reg_ctx (frame->GetRegisterContext());
-                        if (reg_ctx)
-                        {
-                            const uint32_t num_regs = reg_ctx->GetRegisterCount();
-                            for (uint32_t reg_idx = 0; reg_idx < num_regs; ++reg_idx)
-                            {
-                                const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoAtIndex (reg_idx);
-                                if (reg_info && 
-                                    ((reg_info->name && strcasecmp (reg_info->name, name) == 0) ||
-                                     (reg_info->alt_name && strcasecmp (reg_info->alt_name, name) == 0)))
-                                {
-                                    value_sp = ValueObjectRegister::Create (frame, reg_ctx, reg_idx);
-                                    sb_value.SetSP (value_sp);
-                                    break;
-                                }
-                            }
-                        }
-                    }
-                    break;
-
-                case eValueTypeRegisterSet:         // A collection of stack frame register values
-                    {
-                        RegisterContextSP reg_ctx (frame->GetRegisterContext());
-                        if (reg_ctx)
-                        {
-                            const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
-                            for (uint32_t set_idx = 0; set_idx < num_sets; ++set_idx)
-                            {
-                                const RegisterSet *reg_set = reg_ctx->GetRegisterSet (set_idx);
-                                if (reg_set && 
-                                    ((reg_set->name && strcasecmp (reg_set->name, name) == 0) ||
-                                     (reg_set->short_name && strcasecmp (reg_set->short_name, name) == 0)))
-                                {
-                                    value_sp = ValueObjectRegisterSet::Create (frame, reg_ctx, set_idx);
-                                    sb_value.SetSP (value_sp);
-                                    break;
-                                }
-                            }
-                        }
-                    }
-                    break;
-
-                case eValueTypeConstResult:         // constant result variables
-                    {
-                        ConstString const_name(name);
-                        ExpressionVariableSP expr_var_sp (target->GetPersistentVariable (const_name));
-                        if (expr_var_sp)
-                        {
-                            value_sp = expr_var_sp->GetValueObject();
-                            sb_value.SetSP (value_sp, use_dynamic);
-                        }
-                    }
-                    break;
-
-                default:
-                    break;
-                }
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::FindValue () => error: could not reconstruct frame object for this SBFrame.");
-            }
+  ValueObjectSP value_sp;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        VariableList variable_list;
+        SymbolContext sc(frame->GetSymbolContext(eSymbolContextBlock));
+
+        if (sc.block) {
+          const bool can_create = true;
+          const bool get_parent_variables = true;
+          const bool stop_if_block_is_inlined_function = true;
+
+          if (sc.block->AppendVariables(
+                  can_create, get_parent_variables,
+                  stop_if_block_is_inlined_function,
+                  [frame](Variable *v) { return v->IsInScope(frame); },
+                  &variable_list)) {
+            var_sp = variable_list.FindVariable(ConstString(name));
+          }
+        }
+
+        if (var_sp) {
+          value_sp =
+              frame->GetValueObjectForFrameVariable(var_sp, eNoDynamicValues);
+          sb_value.SetSP(value_sp, use_dynamic);
         }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::FindValue () => error: process is running");
-        }
-    }
+      } else {
+        if (log)
+          log->Printf("SBFrame::FindVariable () => error: could not "
+                      "reconstruct frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::FindVariable () => error: process is running");
+    }
+  }
+
+  if (log)
+    log->Printf("SBFrame(%p)::FindVariable (name=\"%s\") => SBValue(%p)",
+                static_cast<void *>(frame), name,
+                static_cast<void *>(value_sp.get()));
+
+  return sb_value;
+}
+
+SBValue SBFrame::FindValue(const char *name, ValueType value_type) {
+  SBValue value;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = exe_ctx.GetFramePtr();
+  Target *target = exe_ctx.GetTargetPtr();
+  if (frame && target) {
+    lldb::DynamicValueType use_dynamic =
+        frame->CalculateTarget()->GetPreferDynamicValue();
+    value = FindValue(name, value_type, use_dynamic);
+  }
+  return value;
+}
+
+SBValue SBFrame::FindValue(const char *name, ValueType value_type,
+                           lldb::DynamicValueType use_dynamic) {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  SBValue sb_value;
 
+  if (name == nullptr || name[0] == '\0') {
     if (log)
-        log->Printf ("SBFrame(%p)::FindVariableInScope (name=\"%s\", value_type=%i) => SBValue(%p)",
-                     static_cast<void*>(frame), name, value_type,
-                     static_cast<void*>(value_sp.get()));
-
+      log->Printf("SBFrame::FindValue called with empty name.");
     return sb_value;
-}
-
-bool
-SBFrame::IsEqual (const SBFrame &that) const
-{
-    lldb::StackFrameSP this_sp = GetFrameSP();
-    lldb::StackFrameSP that_sp = that.GetFrameSP();
-    return (this_sp && that_sp && this_sp->GetStackID() == that_sp->GetStackID());
-}
-
-bool
-SBFrame::operator == (const SBFrame &rhs) const
-{
-    return IsEqual(rhs);
-}
-
-bool
-SBFrame::operator != (const SBFrame &rhs) const
-{
-    return !IsEqual(rhs);
-}
-
-SBThread
-SBFrame::GetThread () const
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+  }
 
-    ThreadSP thread_sp (exe_ctx.GetThreadSP());
-    SBThread sb_thread (thread_sp);
+  ValueObjectSP value_sp;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        VariableList variable_list;
+
+        switch (value_type) {
+        case eValueTypeVariableGlobal:      // global variable
+        case eValueTypeVariableStatic:      // static variable
+        case eValueTypeVariableArgument:    // function argument variables
+        case eValueTypeVariableLocal:       // function local variables
+        case eValueTypeVariableThreadLocal: // thread local variables
+        {
+          SymbolContext sc(frame->GetSymbolContext(eSymbolContextBlock));
+
+          const bool can_create = true;
+          const bool get_parent_variables = true;
+          const bool stop_if_block_is_inlined_function = true;
+
+          if (sc.block)
+            sc.block->AppendVariables(
+                can_create, get_parent_variables,
+                stop_if_block_is_inlined_function,
+                [frame](Variable *v) { return v->IsInScope(frame); },
+                &variable_list);
+          if (value_type == eValueTypeVariableGlobal) {
+            const bool get_file_globals = true;
+            VariableList *frame_vars = frame->GetVariableList(get_file_globals);
+            if (frame_vars)
+              frame_vars->AppendVariablesIfUnique(variable_list);
+          }
+          ConstString const_name(name);
+          VariableSP variable_sp(
+              variable_list.FindVariable(const_name, value_type));
+          if (variable_sp) {
+            value_sp = frame->GetValueObjectForFrameVariable(variable_sp,
+                                                             eNoDynamicValues);
+            sb_value.SetSP(value_sp, use_dynamic);
+          }
+        } break;
+
+        case eValueTypeRegister: // stack frame register value
+        {
+          RegisterContextSP reg_ctx(frame->GetRegisterContext());
+          if (reg_ctx) {
+            const uint32_t num_regs = reg_ctx->GetRegisterCount();
+            for (uint32_t reg_idx = 0; reg_idx < num_regs; ++reg_idx) {
+              const RegisterInfo *reg_info =
+                  reg_ctx->GetRegisterInfoAtIndex(reg_idx);
+              if (reg_info &&
+                  ((reg_info->name && strcasecmp(reg_info->name, name) == 0) ||
+                   (reg_info->alt_name &&
+                    strcasecmp(reg_info->alt_name, name) == 0))) {
+                value_sp = ValueObjectRegister::Create(frame, reg_ctx, reg_idx);
+                sb_value.SetSP(value_sp);
+                break;
+              }
+            }
+          }
+        } break;
+
+        case eValueTypeRegisterSet: // A collection of stack frame register
+                                    // values
+        {
+          RegisterContextSP reg_ctx(frame->GetRegisterContext());
+          if (reg_ctx) {
+            const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
+            for (uint32_t set_idx = 0; set_idx < num_sets; ++set_idx) {
+              const RegisterSet *reg_set = reg_ctx->GetRegisterSet(set_idx);
+              if (reg_set &&
+                  ((reg_set->name && strcasecmp(reg_set->name, name) == 0) ||
+                   (reg_set->short_name &&
+                    strcasecmp(reg_set->short_name, name) == 0))) {
+                value_sp =
+                    ValueObjectRegisterSet::Create(frame, reg_ctx, set_idx);
+                sb_value.SetSP(value_sp);
+                break;
+              }
+            }
+          }
+        } break;
+
+        case eValueTypeConstResult: // constant result variables
+        {
+          ConstString const_name(name);
+          ExpressionVariableSP expr_var_sp(
+              target->GetPersistentVariable(const_name));
+          if (expr_var_sp) {
+            value_sp = expr_var_sp->GetValueObject();
+            sb_value.SetSP(value_sp, use_dynamic);
+          }
+        } break;
 
-    if (log)
-    {
-        SBStream sstr;
-        sb_thread.GetDescription (sstr);
-        log->Printf ("SBFrame(%p)::GetThread () => SBThread(%p): %s",
-                     static_cast<void*>(exe_ctx.GetFramePtr()),
-                     static_cast<void*>(thread_sp.get()), sstr.GetData());
-    }
-
-    return sb_thread;
-}
-
-const char *
-SBFrame::Disassemble () const
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    const char *disassembly = nullptr;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                disassembly = frame->Disassemble();
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::Disassemble () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::Disassemble () => error: process is running");
+        default:
+          break;
         }
-    }
-
-    if (log)
-        log->Printf ("SBFrame(%p)::Disassemble () => %s",
-                     static_cast<void*>(frame), disassembly);
-
-    return disassembly;
-}
-
-SBValueList
-SBFrame::GetVariables (bool arguments,
-                       bool locals,
-                       bool statics,
-                       bool in_scope_only)
-{
-    SBValueList value_list;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = exe_ctx.GetFramePtr();
-    Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
-    {
-        lldb::DynamicValueType use_dynamic = frame->CalculateTarget()->GetPreferDynamicValue();
-        const bool include_runtime_support_values = target ? target->GetDisplayRuntimeSupportValues() : false;
-        
-        SBVariablesOptions options;
-        options.SetIncludeArguments(arguments);
-        options.SetIncludeLocals(locals);
-        options.SetIncludeStatics(statics);
-        options.SetInScopeOnly(in_scope_only);
-        options.SetIncludeRuntimeSupportValues(include_runtime_support_values);
-        options.SetUseDynamic(use_dynamic);
-        
-        value_list = GetVariables (options);
-    }
-    return value_list;
-}
-
-lldb::SBValueList
-SBFrame::GetVariables (bool arguments,
-                       bool locals,
-                       bool statics,
-                       bool in_scope_only,
-                       lldb::DynamicValueType  use_dynamic)
-{
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+      } else {
+        if (log)
+          log->Printf("SBFrame::FindValue () => error: could not reconstruct "
+                      "frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::FindValue () => error: process is running");
+    }
+  }
+
+  if (log)
+    log->Printf("SBFrame(%p)::FindVariableInScope (name=\"%s\", value_type=%i) "
+                "=> SBValue(%p)",
+                static_cast<void *>(frame), name, value_type,
+                static_cast<void *>(value_sp.get()));
+
+  return sb_value;
+}
+
+bool SBFrame::IsEqual(const SBFrame &that) const {
+  lldb::StackFrameSP this_sp = GetFrameSP();
+  lldb::StackFrameSP that_sp = that.GetFrameSP();
+  return (this_sp && that_sp && this_sp->GetStackID() == that_sp->GetStackID());
+}
+
+bool SBFrame::operator==(const SBFrame &rhs) const { return IsEqual(rhs); }
+
+bool SBFrame::operator!=(const SBFrame &rhs) const { return !IsEqual(rhs); }
+
+SBThread SBFrame::GetThread() const {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  ThreadSP thread_sp(exe_ctx.GetThreadSP());
+  SBThread sb_thread(thread_sp);
+
+  if (log) {
+    SBStream sstr;
+    sb_thread.GetDescription(sstr);
+    log->Printf("SBFrame(%p)::GetThread () => SBThread(%p): %s",
+                static_cast<void *>(exe_ctx.GetFramePtr()),
+                static_cast<void *>(thread_sp.get()), sstr.GetData());
+  }
+
+  return sb_thread;
+}
+
+const char *SBFrame::Disassemble() const {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  const char *disassembly = nullptr;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        disassembly = frame->Disassemble();
+      } else {
+        if (log)
+          log->Printf("SBFrame::Disassemble () => error: could not reconstruct "
+                      "frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::Disassemble () => error: process is running");
+    }
+  }
+
+  if (log)
+    log->Printf("SBFrame(%p)::Disassemble () => %s", static_cast<void *>(frame),
+                disassembly);
+
+  return disassembly;
+}
+
+SBValueList SBFrame::GetVariables(bool arguments, bool locals, bool statics,
+                                  bool in_scope_only) {
+  SBValueList value_list;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = exe_ctx.GetFramePtr();
+  Target *target = exe_ctx.GetTargetPtr();
+  if (frame && target) {
+    lldb::DynamicValueType use_dynamic =
+        frame->CalculateTarget()->GetPreferDynamicValue();
+    const bool include_runtime_support_values =
+        target ? target->GetDisplayRuntimeSupportValues() : false;
 
-    Target *target = exe_ctx.GetTargetPtr();
-    const bool include_runtime_support_values = target ? target->GetDisplayRuntimeSupportValues() : false;
     SBVariablesOptions options;
     options.SetIncludeArguments(arguments);
     options.SetIncludeLocals(locals);
@@ -1143,587 +939,533 @@ SBFrame::GetVariables (bool arguments,
     options.SetInScopeOnly(in_scope_only);
     options.SetIncludeRuntimeSupportValues(include_runtime_support_values);
     options.SetUseDynamic(use_dynamic);
-    return GetVariables(options);
-}
 
-SBValueList
-SBFrame::GetVariables (const lldb::SBVariablesOptions& options)
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    SBValueList value_list;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-
-    const bool statics = options.GetIncludeStatics();
-    const bool arguments = options.GetIncludeArguments();
-    const bool locals = options.GetIncludeLocals();
-    const bool in_scope_only = options.GetInScopeOnly();
-    const bool include_runtime_support_values = options.GetIncludeRuntimeSupportValues();
-    const lldb::DynamicValueType use_dynamic = options.GetUseDynamic();
-    
-    if (log)
-        log->Printf ("SBFrame::GetVariables (arguments=%i, locals=%i, statics=%i, in_scope_only=%i runtime=%i dynamic=%i)",
-                     arguments, locals,
-                     statics, in_scope_only,
-                     include_runtime_support_values, use_dynamic);
-
-    std::set<VariableSP> variable_set;
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                size_t i;
-                VariableList *variable_list = nullptr;
-                variable_list = frame->GetVariableList(true);
-                if (variable_list)
-                {
-                    const size_t num_variables = variable_list->GetSize();
-                    if (num_variables)
-                    {
-                        for (i = 0; i < num_variables; ++i)
-                        {
-                            VariableSP variable_sp (variable_list->GetVariableAtIndex(i));
-                            if (variable_sp)
-                            {
-                                bool add_variable = false;
-                                switch (variable_sp->GetScope())
-                                {
-                                case eValueTypeVariableGlobal:
-                                case eValueTypeVariableStatic:
-                                case eValueTypeVariableThreadLocal:
-                                    add_variable = statics;
-                                    break;
-
-                                case eValueTypeVariableArgument:
-                                    add_variable = arguments;
-                                    break;
-
-                                case eValueTypeVariableLocal:
-                                    add_variable = locals;
-                                    break;
-
-                                default:
-                                    break;
-                                }
-                                if (add_variable)
-                                {
-                                    // Only add variables once so we don't end up with duplicates
-                                    if (variable_set.find(variable_sp) == variable_set.end())
-                                        variable_set.insert(variable_sp);
-                                    else
-                                        continue;
-
-                                    if (in_scope_only && !variable_sp->IsInScope(frame))
-                                        continue;
-
-                                    ValueObjectSP valobj_sp(frame->GetValueObjectForFrameVariable (variable_sp, eNoDynamicValues));
-                                    
-                                    if (!include_runtime_support_values &&
-                                        valobj_sp != nullptr &&
-                                        valobj_sp->IsRuntimeSupportValue())
-                                        continue;
-                                    
-                                    SBValue value_sb;
-                                    value_sb.SetSP(valobj_sp,use_dynamic);
-                                    value_list.Append(value_sb);
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::GetVariables () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::GetVariables () => error: process is running");
-        }
-    }
+    value_list = GetVariables(options);
+  }
+  return value_list;
+}
+
+lldb::SBValueList SBFrame::GetVariables(bool arguments, bool locals,
+                                        bool statics, bool in_scope_only,
+                                        lldb::DynamicValueType use_dynamic) {
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  Target *target = exe_ctx.GetTargetPtr();
+  const bool include_runtime_support_values =
+      target ? target->GetDisplayRuntimeSupportValues() : false;
+  SBVariablesOptions options;
+  options.SetIncludeArguments(arguments);
+  options.SetIncludeLocals(locals);
+  options.SetIncludeStatics(statics);
+  options.SetInScopeOnly(in_scope_only);
+  options.SetIncludeRuntimeSupportValues(include_runtime_support_values);
+  options.SetUseDynamic(use_dynamic);
+  return GetVariables(options);
+}
+
+SBValueList SBFrame::GetVariables(const lldb::SBVariablesOptions &options) {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  SBValueList value_list;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+
+  const bool statics = options.GetIncludeStatics();
+  const bool arguments = options.GetIncludeArguments();
+  const bool locals = options.GetIncludeLocals();
+  const bool in_scope_only = options.GetInScopeOnly();
+  const bool include_runtime_support_values =
+      options.GetIncludeRuntimeSupportValues();
+  const lldb::DynamicValueType use_dynamic = options.GetUseDynamic();
+
+  if (log)
+    log->Printf("SBFrame::GetVariables (arguments=%i, locals=%i, statics=%i, "
+                "in_scope_only=%i runtime=%i dynamic=%i)",
+                arguments, locals, statics, in_scope_only,
+                include_runtime_support_values, use_dynamic);
+
+  std::set<VariableSP> variable_set;
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        size_t i;
+        VariableList *variable_list = nullptr;
+        variable_list = frame->GetVariableList(true);
+        if (variable_list) {
+          const size_t num_variables = variable_list->GetSize();
+          if (num_variables) {
+            for (i = 0; i < num_variables; ++i) {
+              VariableSP variable_sp(variable_list->GetVariableAtIndex(i));
+              if (variable_sp) {
+                bool add_variable = false;
+                switch (variable_sp->GetScope()) {
+                case eValueTypeVariableGlobal:
+                case eValueTypeVariableStatic:
+                case eValueTypeVariableThreadLocal:
+                  add_variable = statics;
+                  break;
+
+                case eValueTypeVariableArgument:
+                  add_variable = arguments;
+                  break;
+
+                case eValueTypeVariableLocal:
+                  add_variable = locals;
+                  break;
 
-    if (log)
-        log->Printf ("SBFrame(%p)::GetVariables (...) => SBValueList(%p)",
-                     static_cast<void*>(frame),
-                     static_cast<void*>(value_list.opaque_ptr()));
-
-    return value_list;
-}
-
-SBValueList
-SBFrame::GetRegisters ()
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    SBValueList value_list;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                RegisterContextSP reg_ctx (frame->GetRegisterContext());
-                if (reg_ctx)
-                {
-                    const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
-                    for (uint32_t set_idx = 0; set_idx < num_sets; ++set_idx)
-                    {
-                        value_list.Append(ValueObjectRegisterSet::Create (frame, reg_ctx, set_idx));
-                    }
+                default:
+                  break;
                 }
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::GetRegisters () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::GetRegisters () => error: process is running");
-        }
-    }
-
-    if (log)
-        log->Printf ("SBFrame(%p)::GetRegisters () => SBValueList(%p)",
-                     static_cast<void*>(frame),
-                     static_cast<void*>(value_list.opaque_ptr()));
-
-    return value_list;
-}
-
-SBValue
-SBFrame::FindRegister (const char *name)
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    SBValue result;
-    ValueObjectSP value_sp;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                RegisterContextSP reg_ctx (frame->GetRegisterContext());
-                if (reg_ctx)
-                {
-                    const uint32_t num_regs = reg_ctx->GetRegisterCount();
-                    for (uint32_t reg_idx = 0; reg_idx < num_regs; ++reg_idx)
-                    {
-                        const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoAtIndex (reg_idx);
-                        if (reg_info && 
-                            ((reg_info->name && strcasecmp (reg_info->name, name) == 0) ||
-                             (reg_info->alt_name && strcasecmp (reg_info->alt_name, name) == 0)))
-                        {
-                            value_sp = ValueObjectRegister::Create (frame, reg_ctx, reg_idx);
-                            result.SetSP (value_sp);
-                            break;
-                        }
-                    }
+                if (add_variable) {
+                  // Only add variables once so we don't end up with duplicates
+                  if (variable_set.find(variable_sp) == variable_set.end())
+                    variable_set.insert(variable_sp);
+                  else
+                    continue;
+
+                  if (in_scope_only && !variable_sp->IsInScope(frame))
+                    continue;
+
+                  ValueObjectSP valobj_sp(frame->GetValueObjectForFrameVariable(
+                      variable_sp, eNoDynamicValues));
+
+                  if (!include_runtime_support_values && valobj_sp != nullptr &&
+                      valobj_sp->IsRuntimeSupportValue())
+                    continue;
+
+                  SBValue value_sb;
+                  value_sb.SetSP(valobj_sp, use_dynamic);
+                  value_list.Append(value_sb);
                 }
+              }
             }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::FindRegister () => error: could not reconstruct frame object for this SBFrame.");
-            }
+          }
         }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::FindRegister () => error: process is running");
+      } else {
+        if (log)
+          log->Printf("SBFrame::GetVariables () => error: could not "
+                      "reconstruct frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::GetVariables () => error: process is running");
+    }
+  }
+
+  if (log)
+    log->Printf("SBFrame(%p)::GetVariables (...) => SBValueList(%p)",
+                static_cast<void *>(frame),
+                static_cast<void *>(value_list.opaque_ptr()));
+
+  return value_list;
+}
+
+SBValueList SBFrame::GetRegisters() {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  SBValueList value_list;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        RegisterContextSP reg_ctx(frame->GetRegisterContext());
+        if (reg_ctx) {
+          const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
+          for (uint32_t set_idx = 0; set_idx < num_sets; ++set_idx) {
+            value_list.Append(
+                ValueObjectRegisterSet::Create(frame, reg_ctx, set_idx));
+          }
         }
-    }
-
-    if (log)
-        log->Printf ("SBFrame(%p)::FindRegister () => SBValue(%p)",
-                     static_cast<void*>(frame),
-                     static_cast<void*>(value_sp.get()));
-
-    return result;
-}
-
-bool
-SBFrame::GetDescription (SBStream &description)
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    Stream &strm = description.ref();
-
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                frame->DumpUsingSettingsFormat (&strm);
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::GetDescription () => error: could not reconstruct frame object for this SBFrame.");
+      } else {
+        if (log)
+          log->Printf("SBFrame::GetRegisters () => error: could not "
+                      "reconstruct frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::GetRegisters () => error: process is running");
+    }
+  }
+
+  if (log)
+    log->Printf("SBFrame(%p)::GetRegisters () => SBValueList(%p)",
+                static_cast<void *>(frame),
+                static_cast<void *>(value_list.opaque_ptr()));
+
+  return value_list;
+}
+
+SBValue SBFrame::FindRegister(const char *name) {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  SBValue result;
+  ValueObjectSP value_sp;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        RegisterContextSP reg_ctx(frame->GetRegisterContext());
+        if (reg_ctx) {
+          const uint32_t num_regs = reg_ctx->GetRegisterCount();
+          for (uint32_t reg_idx = 0; reg_idx < num_regs; ++reg_idx) {
+            const RegisterInfo *reg_info =
+                reg_ctx->GetRegisterInfoAtIndex(reg_idx);
+            if (reg_info &&
+                ((reg_info->name && strcasecmp(reg_info->name, name) == 0) ||
+                 (reg_info->alt_name &&
+                  strcasecmp(reg_info->alt_name, name) == 0))) {
+              value_sp = ValueObjectRegister::Create(frame, reg_ctx, reg_idx);
+              result.SetSP(value_sp);
+              break;
             }
+          }
         }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::GetDescription () => error: process is running");
-        }            
-
+      } else {
+        if (log)
+          log->Printf("SBFrame::FindRegister () => error: could not "
+                      "reconstruct frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::FindRegister () => error: process is running");
+    }
+  }
+
+  if (log)
+    log->Printf("SBFrame(%p)::FindRegister () => SBValue(%p)",
+                static_cast<void *>(frame),
+                static_cast<void *>(value_sp.get()));
+
+  return result;
+}
+
+bool SBFrame::GetDescription(SBStream &description) {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  Stream &strm = description.ref();
+
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        frame->DumpUsingSettingsFormat(&strm);
+      } else {
+        if (log)
+          log->Printf("SBFrame::GetDescription () => error: could not "
+                      "reconstruct frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::GetDescription () => error: process is running");
     }
-    else
-        strm.PutCString ("No value");
 
-    return true;
-}
+  } else
+    strm.PutCString("No value");
 
-SBValue
-SBFrame::EvaluateExpression (const char *expr)
-{
-    SBValue result;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = exe_ctx.GetFramePtr();
-    Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
-    {
-        SBExpressionOptions options;
-        lldb::DynamicValueType fetch_dynamic_value = frame->CalculateTarget()->GetPreferDynamicValue();
-        options.SetFetchDynamicValue (fetch_dynamic_value);
-        options.SetUnwindOnError (true);
-        options.SetIgnoreBreakpoints (true);
-        if (target->GetLanguage() != eLanguageTypeUnknown)
-            options.SetLanguage(target->GetLanguage());
-        else
-            options.SetLanguage(frame->GetLanguage());
-        return EvaluateExpression (expr, options);
-    }
-    return result;
+  return true;
 }
 
-SBValue
-SBFrame::EvaluateExpression (const char *expr, lldb::DynamicValueType fetch_dynamic_value)
-{
+SBValue SBFrame::EvaluateExpression(const char *expr) {
+  SBValue result;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = exe_ctx.GetFramePtr();
+  Target *target = exe_ctx.GetTargetPtr();
+  if (frame && target) {
     SBExpressionOptions options;
-    options.SetFetchDynamicValue (fetch_dynamic_value);
-    options.SetUnwindOnError (true);
-    options.SetIgnoreBreakpoints (true);
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = exe_ctx.GetFramePtr();
-    Target *target = exe_ctx.GetTargetPtr();
-    if (target && target->GetLanguage() != eLanguageTypeUnknown)
-        options.SetLanguage(target->GetLanguage());
-    else if (frame)
-        options.SetLanguage(frame->GetLanguage());
-    return EvaluateExpression (expr, options);
+    lldb::DynamicValueType fetch_dynamic_value =
+        frame->CalculateTarget()->GetPreferDynamicValue();
+    options.SetFetchDynamicValue(fetch_dynamic_value);
+    options.SetUnwindOnError(true);
+    options.SetIgnoreBreakpoints(true);
+    if (target->GetLanguage() != eLanguageTypeUnknown)
+      options.SetLanguage(target->GetLanguage());
+    else
+      options.SetLanguage(frame->GetLanguage());
+    return EvaluateExpression(expr, options);
+  }
+  return result;
 }
 
 SBValue
-SBFrame::EvaluateExpression (const char *expr, lldb::DynamicValueType fetch_dynamic_value, bool unwind_on_error)
-{
-    SBExpressionOptions options;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    options.SetFetchDynamicValue (fetch_dynamic_value);
-    options.SetUnwindOnError (unwind_on_error);
-    options.SetIgnoreBreakpoints (true);
-    StackFrame *frame = exe_ctx.GetFramePtr();
-    Target *target = exe_ctx.GetTargetPtr();
-    if (target && target->GetLanguage() != eLanguageTypeUnknown)
-        options.SetLanguage(target->GetLanguage());
-    else if (frame)
-        options.SetLanguage(frame->GetLanguage());
-    return EvaluateExpression (expr, options);
-}
-
-lldb::SBValue
-SBFrame::EvaluateExpression (const char *expr, const SBExpressionOptions &options)
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+SBFrame::EvaluateExpression(const char *expr,
+                            lldb::DynamicValueType fetch_dynamic_value) {
+  SBExpressionOptions options;
+  options.SetFetchDynamicValue(fetch_dynamic_value);
+  options.SetUnwindOnError(true);
+  options.SetIgnoreBreakpoints(true);
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = exe_ctx.GetFramePtr();
+  Target *target = exe_ctx.GetTargetPtr();
+  if (target && target->GetLanguage() != eLanguageTypeUnknown)
+    options.SetLanguage(target->GetLanguage());
+  else if (frame)
+    options.SetLanguage(frame->GetLanguage());
+  return EvaluateExpression(expr, options);
+}
+
+SBValue SBFrame::EvaluateExpression(const char *expr,
+                                    lldb::DynamicValueType fetch_dynamic_value,
+                                    bool unwind_on_error) {
+  SBExpressionOptions options;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  options.SetFetchDynamicValue(fetch_dynamic_value);
+  options.SetUnwindOnError(unwind_on_error);
+  options.SetIgnoreBreakpoints(true);
+  StackFrame *frame = exe_ctx.GetFramePtr();
+  Target *target = exe_ctx.GetTargetPtr();
+  if (target && target->GetLanguage() != eLanguageTypeUnknown)
+    options.SetLanguage(target->GetLanguage());
+  else if (frame)
+    options.SetLanguage(frame->GetLanguage());
+  return EvaluateExpression(expr, options);
+}
+
+lldb::SBValue SBFrame::EvaluateExpression(const char *expr,
+                                          const SBExpressionOptions &options) {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
 #ifndef LLDB_DISABLE_PYTHON
-    Log *expr_log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
+  Log *expr_log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
 #endif
 
-    ExpressionResults exe_results = eExpressionSetupError;
-    SBValue expr_result;
-
-    if (expr == nullptr || expr[0] == '\0')
-    {
-        if (log)
-            log->Printf ("SBFrame::EvaluateExpression called with an empty expression");
-        return expr_result;
-    }
-
-    ValueObjectSP expr_value_sp;
-
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+  ExpressionResults exe_results = eExpressionSetupError;
+  SBValue expr_result;
 
+  if (expr == nullptr || expr[0] == '\0') {
     if (log)
-        log->Printf ("SBFrame()::EvaluateExpression (expr=\"%s\")...", expr);
+      log->Printf(
+          "SBFrame::EvaluateExpression called with an empty expression");
+    return expr_result;
+  }
 
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                if (target->GetDisplayExpressionsInCrashlogs())
-                {
-                    StreamString frame_description;
-                    frame->DumpUsingSettingsFormat (&frame_description);
-                    Host::SetCrashDescriptionWithFormat ("SBFrame::EvaluateExpression (expr = \"%s\", fetch_dynamic_value = %u) %s",
-                                                         expr, options.GetFetchDynamicValue(), frame_description.GetString().c_str());
-                }
+  ValueObjectSP expr_value_sp;
 
-                exe_results = target->EvaluateExpression (expr,
-                                                          frame,
-                                                          expr_value_sp,
-                                                          options.ref());
-                expr_result.SetSP(expr_value_sp, options.GetFetchDynamicValue());
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
 
-                if (target->GetDisplayExpressionsInCrashlogs())
-                    Host::SetCrashDescription(nullptr);
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::EvaluateExpression () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::EvaluateExpression () => error: process is running");
-        }
+  if (log)
+    log->Printf("SBFrame()::EvaluateExpression (expr=\"%s\")...", expr);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        if (target->GetDisplayExpressionsInCrashlogs()) {
+          StreamString frame_description;
+          frame->DumpUsingSettingsFormat(&frame_description);
+          Host::SetCrashDescriptionWithFormat(
+              "SBFrame::EvaluateExpression (expr = \"%s\", fetch_dynamic_value "
+              "= %u) %s",
+              expr, options.GetFetchDynamicValue(),
+              frame_description.GetString().c_str());
+        }
+
+        exe_results = target->EvaluateExpression(expr, frame, expr_value_sp,
+                                                 options.ref());
+        expr_result.SetSP(expr_value_sp, options.GetFetchDynamicValue());
+
+        if (target->GetDisplayExpressionsInCrashlogs())
+          Host::SetCrashDescription(nullptr);
+      } else {
+        if (log)
+          log->Printf("SBFrame::EvaluateExpression () => error: could not "
+                      "reconstruct frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf(
+            "SBFrame::EvaluateExpression () => error: process is running");
     }
+  }
 
 #ifndef LLDB_DISABLE_PYTHON
-    if (expr_log)
-        expr_log->Printf("** [SBFrame::EvaluateExpression] Expression result is %s, summary %s **",
-                         expr_result.GetValue(), expr_result.GetSummary());
-
-    if (log)
-        log->Printf ("SBFrame(%p)::EvaluateExpression (expr=\"%s\") => SBValue(%p) (execution result=%d)",
-                     static_cast<void*>(frame), expr,
-                     static_cast<void*>(expr_value_sp.get()), exe_results);
+  if (expr_log)
+    expr_log->Printf("** [SBFrame::EvaluateExpression] Expression result is "
+                     "%s, summary %s **",
+                     expr_result.GetValue(), expr_result.GetSummary());
+
+  if (log)
+    log->Printf("SBFrame(%p)::EvaluateExpression (expr=\"%s\") => SBValue(%p) "
+                "(execution result=%d)",
+                static_cast<void *>(frame), expr,
+                static_cast<void *>(expr_value_sp.get()), exe_results);
 #endif
 
-    return expr_result;
+  return expr_result;
 }
 
-bool
-SBFrame::IsInlined()
-{
-    return static_cast<const SBFrame*>(this)->IsInlined();
-}
-
-bool
-SBFrame::IsInlined() const
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-
-                Block *block = frame->GetSymbolContext(eSymbolContextBlock).block;
-                if (block)
-                    return block->GetContainingInlinedBlock() != nullptr;
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::IsInlined () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::IsInlined () => error: process is running");
-        }            
-
-    }
-    return false;
-}
-
-const char *
-SBFrame::GetFunctionName()
-{
-    return static_cast<const SBFrame*>(this)->GetFunctionName();
-}
-
-const char *
-SBFrame::GetFunctionName() const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    const char *name = nullptr;
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                SymbolContext sc (frame->GetSymbolContext(eSymbolContextFunction | eSymbolContextBlock | eSymbolContextSymbol));
-                if (sc.block)
-                {
-                    Block *inlined_block = sc.block->GetContainingInlinedBlock ();
-                    if (inlined_block)
-                    {
-                        const InlineFunctionInfo* inlined_info = inlined_block->GetInlinedFunctionInfo();
-                        name = inlined_info->GetName(sc.function->GetLanguage()).AsCString();
-                    }
-                }
-                
-                if (name == nullptr)
-                {
-                    if (sc.function)
-                        name = sc.function->GetName().GetCString();
-                }
-
-                if (name == nullptr)
-                {
-                    if (sc.symbol)
-                        name = sc.symbol->GetName().GetCString();
-                }
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::GetFunctionName () => error: could not reconstruct frame object for this SBFrame.");
-            }
-        }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::GetFunctionName() => error: process is running");
-
-        }
-    }
-    return name;
+bool SBFrame::IsInlined() {
+  return static_cast<const SBFrame *>(this)->IsInlined();
 }
 
-const char *
-SBFrame::GetDisplayFunctionName()
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    const char *name = nullptr;
-
-    std::unique_lock<std::recursive_mutex> lock;
-    ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
-
-    StackFrame *frame = nullptr;
-    Target *target = exe_ctx.GetTargetPtr();
-    Process *process = exe_ctx.GetProcessPtr();
-    if (target && process)
-    {
-        Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&process->GetRunLock()))
-        {
-            frame = exe_ctx.GetFramePtr();
-            if (frame)
-            {
-                SymbolContext sc (frame->GetSymbolContext(eSymbolContextFunction | eSymbolContextBlock | eSymbolContextSymbol));
-                if (sc.block)
-                {
-                    Block *inlined_block = sc.block->GetContainingInlinedBlock ();
-                    if (inlined_block)
-                    {
-                        const InlineFunctionInfo* inlined_info = inlined_block->GetInlinedFunctionInfo();
-                        name = inlined_info->GetDisplayName(sc.function->GetLanguage()).AsCString();
-                    }
-                }
-                
-                if (name == nullptr)
-                {
-                    if (sc.function)
-                        name = sc.function->GetDisplayName().GetCString();
-                }
-                
-                if (name == nullptr)
-                {
-                    if (sc.symbol)
-                        name = sc.symbol->GetDisplayName().GetCString();
-                }
-            }
-            else
-            {
-                if (log)
-                    log->Printf ("SBFrame::GetDisplayFunctionName () => error: could not reconstruct frame object for this SBFrame.");
-            }
+bool SBFrame::IsInlined() const {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+
+        Block *block = frame->GetSymbolContext(eSymbolContextBlock).block;
+        if (block)
+          return block->GetContainingInlinedBlock() != nullptr;
+      } else {
+        if (log)
+          log->Printf("SBFrame::IsInlined () => error: could not reconstruct "
+                      "frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::IsInlined () => error: process is running");
+    }
+  }
+  return false;
+}
+
+const char *SBFrame::GetFunctionName() {
+  return static_cast<const SBFrame *>(this)->GetFunctionName();
+}
+
+const char *SBFrame::GetFunctionName() const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  const char *name = nullptr;
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        SymbolContext sc(frame->GetSymbolContext(eSymbolContextFunction |
+                                                 eSymbolContextBlock |
+                                                 eSymbolContextSymbol));
+        if (sc.block) {
+          Block *inlined_block = sc.block->GetContainingInlinedBlock();
+          if (inlined_block) {
+            const InlineFunctionInfo *inlined_info =
+                inlined_block->GetInlinedFunctionInfo();
+            name =
+                inlined_info->GetName(sc.function->GetLanguage()).AsCString();
+          }
+        }
+
+        if (name == nullptr) {
+          if (sc.function)
+            name = sc.function->GetName().GetCString();
+        }
+
+        if (name == nullptr) {
+          if (sc.symbol)
+            name = sc.symbol->GetName().GetCString();
         }
-        else
-        {
-            if (log)
-                log->Printf ("SBFrame::GetDisplayFunctionName() => error: process is running");
-            
+      } else {
+        if (log)
+          log->Printf("SBFrame::GetFunctionName () => error: could not "
+                      "reconstruct frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf("SBFrame::GetFunctionName() => error: process is running");
+    }
+  }
+  return name;
+}
+
+const char *SBFrame::GetDisplayFunctionName() {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  const char *name = nullptr;
+
+  std::unique_lock<std::recursive_mutex> lock;
+  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+  StackFrame *frame = nullptr;
+  Target *target = exe_ctx.GetTargetPtr();
+  Process *process = exe_ctx.GetProcessPtr();
+  if (target && process) {
+    Process::StopLocker stop_locker;
+    if (stop_locker.TryLock(&process->GetRunLock())) {
+      frame = exe_ctx.GetFramePtr();
+      if (frame) {
+        SymbolContext sc(frame->GetSymbolContext(eSymbolContextFunction |
+                                                 eSymbolContextBlock |
+                                                 eSymbolContextSymbol));
+        if (sc.block) {
+          Block *inlined_block = sc.block->GetContainingInlinedBlock();
+          if (inlined_block) {
+            const InlineFunctionInfo *inlined_info =
+                inlined_block->GetInlinedFunctionInfo();
+            name = inlined_info->GetDisplayName(sc.function->GetLanguage())
+                       .AsCString();
+          }
+        }
+
+        if (name == nullptr) {
+          if (sc.function)
+            name = sc.function->GetDisplayName().GetCString();
+        }
+
+        if (name == nullptr) {
+          if (sc.symbol)
+            name = sc.symbol->GetDisplayName().GetCString();
         }
+      } else {
+        if (log)
+          log->Printf("SBFrame::GetDisplayFunctionName () => error: could not "
+                      "reconstruct frame object for this SBFrame.");
+      }
+    } else {
+      if (log)
+        log->Printf(
+            "SBFrame::GetDisplayFunctionName() => error: process is running");
     }
-    return name;
+  }
+  return name;
 }

Modified: lldb/trunk/source/API/SBFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFunction.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFunction.cpp (original)
+++ lldb/trunk/source/API/SBFunction.cpp Tue Sep  6 15:57:50 2016
@@ -23,267 +23,200 @@
 using namespace lldb;
 using namespace lldb_private;
 
-SBFunction::SBFunction () :
-    m_opaque_ptr (NULL)
-{
-}
-
-SBFunction::SBFunction (lldb_private::Function *lldb_object_ptr) :
-    m_opaque_ptr (lldb_object_ptr)
-{
-}
-
-SBFunction::SBFunction (const lldb::SBFunction &rhs) :
-    m_opaque_ptr (rhs.m_opaque_ptr)
-{
-}
-
-const SBFunction &
-SBFunction::operator = (const SBFunction &rhs)
-{
-    m_opaque_ptr = rhs.m_opaque_ptr;
-    return *this;
-}
-
-SBFunction::~SBFunction ()
-{
-    m_opaque_ptr = NULL;
-}
-
-bool
-SBFunction::IsValid () const
-{
-    return m_opaque_ptr != NULL;
-}
-
-const char *
-SBFunction::GetName() const
-{
-    const char *cstr = NULL;
-    if (m_opaque_ptr)
-        cstr = m_opaque_ptr->GetName().AsCString();
-
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-    {
-        if (cstr)
-            log->Printf ("SBFunction(%p)::GetName () => \"%s\"",
-                         static_cast<void*>(m_opaque_ptr), cstr);
-        else
-            log->Printf ("SBFunction(%p)::GetName () => NULL",
-                         static_cast<void*>(m_opaque_ptr));
-    }
-    return cstr;
-}
-
-const char *
-SBFunction::GetDisplayName() const
-{
-    const char *cstr = NULL;
-    if (m_opaque_ptr)
-        cstr = m_opaque_ptr->GetMangled().GetDisplayDemangledName(m_opaque_ptr->GetLanguage()).AsCString();
-    
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-    {
-        if (cstr)
-        log->Printf ("SBFunction(%p)::GetDisplayName () => \"%s\"",
-                     static_cast<void*>(m_opaque_ptr), cstr);
-        else
-        log->Printf ("SBFunction(%p)::GetDisplayName () => NULL",
-                     static_cast<void*>(m_opaque_ptr));
-    }
-    return cstr;
-}
-
-const char *
-SBFunction::GetMangledName () const
-{
-    const char *cstr = NULL;
-    if (m_opaque_ptr)
-        cstr = m_opaque_ptr->GetMangled().GetMangledName().AsCString();
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-    {
-        if (cstr)
-            log->Printf ("SBFunction(%p)::GetMangledName () => \"%s\"",
-                         static_cast<void*>(m_opaque_ptr), cstr);
-        else
-            log->Printf ("SBFunction(%p)::GetMangledName () => NULL",
-                         static_cast<void*>(m_opaque_ptr));
-    }
-    return cstr;
-}
-
-bool
-SBFunction::operator == (const SBFunction &rhs) const
-{
-    return m_opaque_ptr == rhs.m_opaque_ptr;
-}
-
-bool
-SBFunction::operator != (const SBFunction &rhs) const
-{
-    return m_opaque_ptr != rhs.m_opaque_ptr;
-}
-
-bool
-SBFunction::GetDescription (SBStream &s)
-{
-    if (m_opaque_ptr)
-    {
-        s.Printf ("SBFunction: id = 0x%8.8" PRIx64 ", name = %s",
-                  m_opaque_ptr->GetID(),
-                  m_opaque_ptr->GetName().AsCString());
-        Type *func_type = m_opaque_ptr->GetType();
-        if (func_type)
-            s.Printf(", type = %s", func_type->GetName().AsCString());
-        return true;
-    }
-    s.Printf ("No value");
-    return false;
-}
+SBFunction::SBFunction() : m_opaque_ptr(NULL) {}
 
-SBInstructionList
-SBFunction::GetInstructions (SBTarget target)
-{
-    return GetInstructions (target, NULL);
-}
-
-SBInstructionList
-SBFunction::GetInstructions (SBTarget target, const char *flavor)
-{
-    SBInstructionList sb_instructions;
-    if (m_opaque_ptr)
-    {
-        ExecutionContext exe_ctx;
-        TargetSP target_sp (target.GetSP());
-        std::unique_lock<std::recursive_mutex> lock;
-        if (target_sp)
-        {
-            lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
-            target_sp->CalculateExecutionContext (exe_ctx);
-            exe_ctx.SetProcessSP(target_sp->GetProcessSP());
-        }
-        ModuleSP module_sp (m_opaque_ptr->GetAddressRange().GetBaseAddress().GetModule());
-        if (module_sp)
-        {
-            const bool prefer_file_cache = false;
-            sb_instructions.SetDisassembler (Disassembler::DisassembleRange (module_sp->GetArchitecture(),
-                                                                             NULL,
-                                                                             flavor,
-                                                                             exe_ctx,
-                                                                             m_opaque_ptr->GetAddressRange(),
-                                                                             prefer_file_cache));
-        }
-    }
-    return sb_instructions;
-}
+SBFunction::SBFunction(lldb_private::Function *lldb_object_ptr)
+    : m_opaque_ptr(lldb_object_ptr) {}
 
-lldb_private::Function *
-SBFunction::get ()
-{
-    return m_opaque_ptr;
-}
-
-void
-SBFunction::reset (lldb_private::Function *lldb_object_ptr)
-{
-    m_opaque_ptr = lldb_object_ptr;
-}
-
-SBAddress
-SBFunction::GetStartAddress ()
-{
-    SBAddress addr;
-    if (m_opaque_ptr)
-        addr.SetAddress (&m_opaque_ptr->GetAddressRange().GetBaseAddress());
-    return addr;
-}
-
-SBAddress
-SBFunction::GetEndAddress ()
-{
-    SBAddress addr;
-    if (m_opaque_ptr)
-    {
-        addr_t byte_size = m_opaque_ptr->GetAddressRange().GetByteSize();
-        if (byte_size > 0)
-        {
-            addr.SetAddress (&m_opaque_ptr->GetAddressRange().GetBaseAddress());
-            addr->Slide (byte_size);
-        }
-    }
-    return addr;
-}
+SBFunction::SBFunction(const lldb::SBFunction &rhs)
+    : m_opaque_ptr(rhs.m_opaque_ptr) {}
 
-const char *
-SBFunction::GetArgumentName (uint32_t arg_idx)
-{
-    if (m_opaque_ptr)
-    {
-        Block &block = m_opaque_ptr->GetBlock(true);
-        VariableListSP variable_list_sp = block.GetBlockVariableList(true);
-        if (variable_list_sp)
-        {
-            VariableList arguments;
-            variable_list_sp->AppendVariablesWithScope (eValueTypeVariableArgument, arguments, true);
-            lldb::VariableSP variable_sp = arguments.GetVariableAtIndex(arg_idx);
-            if (variable_sp)
-                return variable_sp->GetName().GetCString();
-        }
-    }
-    return nullptr;
-}
-
-uint32_t
-SBFunction::GetPrologueByteSize ()
-{
-    if (m_opaque_ptr)
-        return m_opaque_ptr->GetPrologueByteSize();
-    return 0;
-}
-
-SBType
-SBFunction::GetType ()
-{
-    SBType sb_type;
-    if (m_opaque_ptr)
-    {
-        Type *function_type = m_opaque_ptr->GetType();
-        if (function_type)
-            sb_type.ref().SetType (function_type->shared_from_this());
-    }
-    return sb_type;
-}
-
-SBBlock
-SBFunction::GetBlock ()
-{
-    SBBlock sb_block;
-    if (m_opaque_ptr)
-        sb_block.SetPtr (&m_opaque_ptr->GetBlock (true));
-    return sb_block;
-}
-
-lldb::LanguageType
-SBFunction::GetLanguage ()
-{
-    if (m_opaque_ptr)
-    {
-        if (m_opaque_ptr->GetCompileUnit())
-            return m_opaque_ptr->GetCompileUnit()->GetLanguage();
-    }
-    return lldb::eLanguageTypeUnknown;
-}
-
-bool
-SBFunction::GetIsOptimized ()
-{
-    if (m_opaque_ptr)
-    {
-        if (m_opaque_ptr->GetCompileUnit())
-            return m_opaque_ptr->GetCompileUnit()->GetIsOptimized();
-    }
-    return false;
+const SBFunction &SBFunction::operator=(const SBFunction &rhs) {
+  m_opaque_ptr = rhs.m_opaque_ptr;
+  return *this;
+}
+
+SBFunction::~SBFunction() { m_opaque_ptr = NULL; }
+
+bool SBFunction::IsValid() const { return m_opaque_ptr != NULL; }
+
+const char *SBFunction::GetName() const {
+  const char *cstr = NULL;
+  if (m_opaque_ptr)
+    cstr = m_opaque_ptr->GetName().AsCString();
+
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log) {
+    if (cstr)
+      log->Printf("SBFunction(%p)::GetName () => \"%s\"",
+                  static_cast<void *>(m_opaque_ptr), cstr);
+    else
+      log->Printf("SBFunction(%p)::GetName () => NULL",
+                  static_cast<void *>(m_opaque_ptr));
+  }
+  return cstr;
+}
+
+const char *SBFunction::GetDisplayName() const {
+  const char *cstr = NULL;
+  if (m_opaque_ptr)
+    cstr = m_opaque_ptr->GetMangled()
+               .GetDisplayDemangledName(m_opaque_ptr->GetLanguage())
+               .AsCString();
+
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log) {
+    if (cstr)
+      log->Printf("SBFunction(%p)::GetDisplayName () => \"%s\"",
+                  static_cast<void *>(m_opaque_ptr), cstr);
+    else
+      log->Printf("SBFunction(%p)::GetDisplayName () => NULL",
+                  static_cast<void *>(m_opaque_ptr));
+  }
+  return cstr;
+}
+
+const char *SBFunction::GetMangledName() const {
+  const char *cstr = NULL;
+  if (m_opaque_ptr)
+    cstr = m_opaque_ptr->GetMangled().GetMangledName().AsCString();
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log) {
+    if (cstr)
+      log->Printf("SBFunction(%p)::GetMangledName () => \"%s\"",
+                  static_cast<void *>(m_opaque_ptr), cstr);
+    else
+      log->Printf("SBFunction(%p)::GetMangledName () => NULL",
+                  static_cast<void *>(m_opaque_ptr));
+  }
+  return cstr;
+}
+
+bool SBFunction::operator==(const SBFunction &rhs) const {
+  return m_opaque_ptr == rhs.m_opaque_ptr;
+}
+
+bool SBFunction::operator!=(const SBFunction &rhs) const {
+  return m_opaque_ptr != rhs.m_opaque_ptr;
+}
+
+bool SBFunction::GetDescription(SBStream &s) {
+  if (m_opaque_ptr) {
+    s.Printf("SBFunction: id = 0x%8.8" PRIx64 ", name = %s",
+             m_opaque_ptr->GetID(), m_opaque_ptr->GetName().AsCString());
+    Type *func_type = m_opaque_ptr->GetType();
+    if (func_type)
+      s.Printf(", type = %s", func_type->GetName().AsCString());
+    return true;
+  }
+  s.Printf("No value");
+  return false;
+}
+
+SBInstructionList SBFunction::GetInstructions(SBTarget target) {
+  return GetInstructions(target, NULL);
+}
+
+SBInstructionList SBFunction::GetInstructions(SBTarget target,
+                                              const char *flavor) {
+  SBInstructionList sb_instructions;
+  if (m_opaque_ptr) {
+    ExecutionContext exe_ctx;
+    TargetSP target_sp(target.GetSP());
+    std::unique_lock<std::recursive_mutex> lock;
+    if (target_sp) {
+      lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
+      target_sp->CalculateExecutionContext(exe_ctx);
+      exe_ctx.SetProcessSP(target_sp->GetProcessSP());
+    }
+    ModuleSP module_sp(
+        m_opaque_ptr->GetAddressRange().GetBaseAddress().GetModule());
+    if (module_sp) {
+      const bool prefer_file_cache = false;
+      sb_instructions.SetDisassembler(Disassembler::DisassembleRange(
+          module_sp->GetArchitecture(), NULL, flavor, exe_ctx,
+          m_opaque_ptr->GetAddressRange(), prefer_file_cache));
+    }
+  }
+  return sb_instructions;
+}
+
+lldb_private::Function *SBFunction::get() { return m_opaque_ptr; }
+
+void SBFunction::reset(lldb_private::Function *lldb_object_ptr) {
+  m_opaque_ptr = lldb_object_ptr;
+}
+
+SBAddress SBFunction::GetStartAddress() {
+  SBAddress addr;
+  if (m_opaque_ptr)
+    addr.SetAddress(&m_opaque_ptr->GetAddressRange().GetBaseAddress());
+  return addr;
+}
+
+SBAddress SBFunction::GetEndAddress() {
+  SBAddress addr;
+  if (m_opaque_ptr) {
+    addr_t byte_size = m_opaque_ptr->GetAddressRange().GetByteSize();
+    if (byte_size > 0) {
+      addr.SetAddress(&m_opaque_ptr->GetAddressRange().GetBaseAddress());
+      addr->Slide(byte_size);
+    }
+  }
+  return addr;
+}
+
+const char *SBFunction::GetArgumentName(uint32_t arg_idx) {
+  if (m_opaque_ptr) {
+    Block &block = m_opaque_ptr->GetBlock(true);
+    VariableListSP variable_list_sp = block.GetBlockVariableList(true);
+    if (variable_list_sp) {
+      VariableList arguments;
+      variable_list_sp->AppendVariablesWithScope(eValueTypeVariableArgument,
+                                                 arguments, true);
+      lldb::VariableSP variable_sp = arguments.GetVariableAtIndex(arg_idx);
+      if (variable_sp)
+        return variable_sp->GetName().GetCString();
+    }
+  }
+  return nullptr;
+}
+
+uint32_t SBFunction::GetPrologueByteSize() {
+  if (m_opaque_ptr)
+    return m_opaque_ptr->GetPrologueByteSize();
+  return 0;
+}
+
+SBType SBFunction::GetType() {
+  SBType sb_type;
+  if (m_opaque_ptr) {
+    Type *function_type = m_opaque_ptr->GetType();
+    if (function_type)
+      sb_type.ref().SetType(function_type->shared_from_this());
+  }
+  return sb_type;
+}
+
+SBBlock SBFunction::GetBlock() {
+  SBBlock sb_block;
+  if (m_opaque_ptr)
+    sb_block.SetPtr(&m_opaque_ptr->GetBlock(true));
+  return sb_block;
+}
+
+lldb::LanguageType SBFunction::GetLanguage() {
+  if (m_opaque_ptr) {
+    if (m_opaque_ptr->GetCompileUnit())
+      return m_opaque_ptr->GetCompileUnit()->GetLanguage();
+  }
+  return lldb::eLanguageTypeUnknown;
+}
+
+bool SBFunction::GetIsOptimized() {
+  if (m_opaque_ptr) {
+    if (m_opaque_ptr->GetCompileUnit())
+      return m_opaque_ptr->GetCompileUnit()->GetIsOptimized();
+  }
+  return false;
 }

Modified: lldb/trunk/source/API/SBHostOS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBHostOS.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBHostOS.cpp (original)
+++ lldb/trunk/source/API/SBHostOS.cpp Tue Sep  6 15:57:50 2016
@@ -9,133 +9,108 @@
 
 #include "lldb/API/SBHostOS.h"
 #include "lldb/API/SBError.h"
-#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Log.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Host/HostNativeThread.h"
 #include "lldb/Host/HostThread.h"
 #include "lldb/Host/ThreadLauncher.h"
 
-#include "llvm/Support/Path.h"
 #include "llvm/ADT/SmallString.h"
+#include "llvm/Support/Path.h"
 
 using namespace lldb;
 using namespace lldb_private;
 
+SBFileSpec SBHostOS::GetProgramFileSpec() {
+  SBFileSpec sb_filespec;
+  sb_filespec.SetFileSpec(HostInfo::GetProgramFileSpec());
+  return sb_filespec;
+}
+
+SBFileSpec SBHostOS::GetLLDBPythonPath() {
+  SBFileSpec sb_lldb_python_filespec;
+  FileSpec lldb_python_spec;
+  if (HostInfo::GetLLDBPath(ePathTypePythonDir, lldb_python_spec)) {
+    sb_lldb_python_filespec.SetFileSpec(lldb_python_spec);
+  }
+  return sb_lldb_python_filespec;
+}
+
+SBFileSpec SBHostOS::GetLLDBPath(lldb::PathType path_type) {
+  SBFileSpec sb_fspec;
+  FileSpec fspec;
+  if (HostInfo::GetLLDBPath(path_type, fspec))
+    sb_fspec.SetFileSpec(fspec);
+  return sb_fspec;
+}
+
+SBFileSpec SBHostOS::GetUserHomeDirectory() {
+  SBFileSpec sb_fspec;
+
+  llvm::SmallString<64> home_dir_path;
+  llvm::sys::path::home_directory(home_dir_path);
+  FileSpec homedir(home_dir_path.c_str(), true);
 
+  sb_fspec.SetFileSpec(homedir);
+  return sb_fspec;
+}
+
+lldb::thread_t SBHostOS::ThreadCreate(const char *name,
+                                      lldb::thread_func_t thread_function,
+                                      void *thread_arg, SBError *error_ptr) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  if (log)
+    log->Printf(
+        "SBHostOS::ThreadCreate (name=\"%s\", thread_function=%p, "
+        "thread_arg=%p, error_ptr=%p)",
+        name,
+        reinterpret_cast<void *>(reinterpret_cast<intptr_t>(thread_function)),
+        static_cast<void *>(thread_arg), static_cast<void *>(error_ptr));
+
+  // FIXME: You should log the return value?
+
+  HostThread thread(ThreadLauncher::LaunchThread(
+      name, thread_function, thread_arg, error_ptr ? error_ptr->get() : NULL));
+  return thread.Release();
+}
 
-SBFileSpec
-SBHostOS::GetProgramFileSpec ()
-{
-    SBFileSpec sb_filespec;
-    sb_filespec.SetFileSpec(HostInfo::GetProgramFileSpec());
-    return sb_filespec;
-}
-
-SBFileSpec
-SBHostOS::GetLLDBPythonPath ()
-{
-    SBFileSpec sb_lldb_python_filespec;
-    FileSpec lldb_python_spec;
-    if (HostInfo::GetLLDBPath(ePathTypePythonDir, lldb_python_spec))
-    {
-        sb_lldb_python_filespec.SetFileSpec (lldb_python_spec);
-    }
-    return sb_lldb_python_filespec;
-}
-
-
-SBFileSpec
-SBHostOS::GetLLDBPath (lldb::PathType path_type)
-{
-    SBFileSpec sb_fspec;
-    FileSpec fspec;
-    if (HostInfo::GetLLDBPath(path_type, fspec))
-        sb_fspec.SetFileSpec (fspec);
-    return sb_fspec;
-}
-
-SBFileSpec
-SBHostOS::GetUserHomeDirectory ()
-{
-    SBFileSpec sb_fspec;
-
-    llvm::SmallString<64> home_dir_path;
-    llvm::sys::path::home_directory (home_dir_path);
-    FileSpec homedir (home_dir_path.c_str(), true);
-
-    sb_fspec.SetFileSpec (homedir);
-    return sb_fspec;
-}
-
-lldb::thread_t
-SBHostOS::ThreadCreate
-(
-    const char *name,
-    lldb::thread_func_t thread_function,
-    void *thread_arg,
-    SBError *error_ptr
-)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBHostOS::ThreadCreate (name=\"%s\", thread_function=%p, thread_arg=%p, error_ptr=%p)",
-                     name, reinterpret_cast<void*>(reinterpret_cast<intptr_t>(thread_function)),
-                     static_cast<void*>(thread_arg),
-                     static_cast<void*>(error_ptr));
-
-    // FIXME: You should log the return value?
-
-    HostThread thread(ThreadLauncher::LaunchThread(name, thread_function, thread_arg, error_ptr ? error_ptr->get() : NULL));
-    return thread.Release();
-}
-
-void
-SBHostOS::ThreadCreated (const char *name)
-{
-}
-
-bool
-SBHostOS::ThreadCancel (lldb::thread_t thread, SBError *error_ptr)
-{
-    Error error;
-    HostThread host_thread(thread);
-    error = host_thread.Cancel();
-    if (error_ptr)
-        error_ptr->SetError(error);
-    host_thread.Release();
-    return error.Success();
-}
-
-bool
-SBHostOS::ThreadDetach (lldb::thread_t thread, SBError *error_ptr)
-{
-    Error error;
+void SBHostOS::ThreadCreated(const char *name) {}
+
+bool SBHostOS::ThreadCancel(lldb::thread_t thread, SBError *error_ptr) {
+  Error error;
+  HostThread host_thread(thread);
+  error = host_thread.Cancel();
+  if (error_ptr)
+    error_ptr->SetError(error);
+  host_thread.Release();
+  return error.Success();
+}
+
+bool SBHostOS::ThreadDetach(lldb::thread_t thread, SBError *error_ptr) {
+  Error error;
 #if defined(_WIN32)
-    if (error_ptr)
-        error_ptr->SetErrorString("ThreadDetach is not supported on this platform");
+  if (error_ptr)
+    error_ptr->SetErrorString("ThreadDetach is not supported on this platform");
 #else
-    HostThread host_thread(thread);
-    error = host_thread.GetNativeThread().Detach();
-    if (error_ptr)
-        error_ptr->SetError(error);
-    host_thread.Release();
+  HostThread host_thread(thread);
+  error = host_thread.GetNativeThread().Detach();
+  if (error_ptr)
+    error_ptr->SetError(error);
+  host_thread.Release();
 #endif
-    return error.Success();
+  return error.Success();
 }
 
-bool
-SBHostOS::ThreadJoin (lldb::thread_t thread, lldb::thread_result_t *result, SBError *error_ptr)
-{
-    Error error;
-    HostThread host_thread(thread);
-    error = host_thread.Join(result);
-    if (error_ptr)
-        error_ptr->SetError(error);
-    host_thread.Release();
-    return error.Success();
+bool SBHostOS::ThreadJoin(lldb::thread_t thread, lldb::thread_result_t *result,
+                          SBError *error_ptr) {
+  Error error;
+  HostThread host_thread(thread);
+  error = host_thread.Join(result);
+  if (error_ptr)
+    error_ptr->SetError(error);
+  host_thread.Release();
+  return error.Success();
 }
-
-

Modified: lldb/trunk/source/API/SBInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBInstruction.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBInstruction.cpp (original)
+++ lldb/trunk/source/API/SBInstruction.cpp Tue Sep  6 15:57:50 2016
@@ -47,299 +47,232 @@
 // the disassembler and the instruction so that the object can live and
 // successfully respond to all queries.
 //----------------------------------------------------------------------
-class InstructionImpl
-{
+class InstructionImpl {
 public:
-    InstructionImpl (const lldb::DisassemblerSP &disasm_sp, const lldb::InstructionSP& inst_sp) :
-        m_disasm_sp(disasm_sp),
-        m_inst_sp(inst_sp)
-    {
-    }
+  InstructionImpl(const lldb::DisassemblerSP &disasm_sp,
+                  const lldb::InstructionSP &inst_sp)
+      : m_disasm_sp(disasm_sp), m_inst_sp(inst_sp) {}
 
-    lldb::InstructionSP
-    GetSP() const
-    {
-        return m_inst_sp;
-    }
+  lldb::InstructionSP GetSP() const { return m_inst_sp; }
 
-    bool
-    IsValid() const
-    {
-        return (bool)m_inst_sp;
-    }
+  bool IsValid() const { return (bool)m_inst_sp; }
 
 protected:
-    lldb::DisassemblerSP m_disasm_sp; // Can be empty/invalid
-    lldb::InstructionSP m_inst_sp;
+  lldb::DisassemblerSP m_disasm_sp; // Can be empty/invalid
+  lldb::InstructionSP m_inst_sp;
 };
 
 using namespace lldb;
 using namespace lldb_private;
 
-SBInstruction::SBInstruction() :
-    m_opaque_sp()
-{
-}
-
-SBInstruction::SBInstruction(const lldb::DisassemblerSP &disasm_sp, const lldb::InstructionSP& inst_sp) :
-    m_opaque_sp(new InstructionImpl(disasm_sp, inst_sp))
-{
-}
-
-SBInstruction::SBInstruction(const SBInstruction &rhs) :
-    m_opaque_sp (rhs.m_opaque_sp)
-{
-}
-
-const SBInstruction &
-SBInstruction::operator = (const SBInstruction &rhs)
-{
-    if (this != &rhs)
-        m_opaque_sp = rhs.m_opaque_sp;
-    return *this;
-}
-
-SBInstruction::~SBInstruction ()
-{
-}
-
-bool
-SBInstruction::IsValid()
-{
-    return m_opaque_sp && m_opaque_sp->IsValid();
-}
-
-SBAddress
-SBInstruction::GetAddress()
-{
-    SBAddress sb_addr;
-    lldb::InstructionSP inst_sp(GetOpaque());
-    if (inst_sp && inst_sp->GetAddress().IsValid())
-        sb_addr.SetAddress(&inst_sp->GetAddress());
-    return sb_addr;
-}
-
-const char *
-SBInstruction::GetMnemonic(SBTarget target)
-{
-    lldb::InstructionSP inst_sp(GetOpaque());
-    if (inst_sp)
-    {        
-        ExecutionContext exe_ctx;
-        TargetSP target_sp (target.GetSP());
-        std::unique_lock<std::recursive_mutex> lock;
-        if (target_sp)
-        {
-            lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
-
-            target_sp->CalculateExecutionContext (exe_ctx);
-            exe_ctx.SetProcessSP(target_sp->GetProcessSP());
-        }
-        return inst_sp->GetMnemonic(&exe_ctx);
-    }
-    return NULL;
-}
-
-const char *
-SBInstruction::GetOperands(SBTarget target)
-{
-    lldb::InstructionSP inst_sp(GetOpaque());
-    if (inst_sp)
-    {
-        ExecutionContext exe_ctx;
-        TargetSP target_sp (target.GetSP());
-        std::unique_lock<std::recursive_mutex> lock;
-        if (target_sp)
-        {
-            lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
-
-            target_sp->CalculateExecutionContext (exe_ctx);
-            exe_ctx.SetProcessSP(target_sp->GetProcessSP());
-        }
-        return inst_sp->GetOperands(&exe_ctx);
-    }
-    return NULL;
-}
-
-const char *
-SBInstruction::GetComment(SBTarget target)
-{
-    lldb::InstructionSP inst_sp(GetOpaque());
-    if (inst_sp)
-    {
-        ExecutionContext exe_ctx;
-        TargetSP target_sp (target.GetSP());
-        std::unique_lock<std::recursive_mutex> lock;
-        if (target_sp)
-        {
-            lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
-
-            target_sp->CalculateExecutionContext (exe_ctx);
-            exe_ctx.SetProcessSP(target_sp->GetProcessSP());
-        }
-        return inst_sp->GetComment(&exe_ctx);
-    }
-    return NULL;
-}
-
-size_t
-SBInstruction::GetByteSize ()
-{
-    lldb::InstructionSP inst_sp(GetOpaque());
-    if (inst_sp)
-        return inst_sp->GetOpcode().GetByteSize();
-    return 0;
-}
-
-SBData
-SBInstruction::GetData (SBTarget target)
-{
-    lldb::SBData sb_data;
-    lldb::InstructionSP inst_sp(GetOpaque());
-    if (inst_sp)
-    {
-        DataExtractorSP data_extractor_sp (new DataExtractor());
-        if (inst_sp->GetData (*data_extractor_sp))
-        {
-            sb_data.SetOpaque (data_extractor_sp);
-        }
-    }
-    return sb_data;
-}
-
-
-
-bool
-SBInstruction::DoesBranch ()
-{
-    lldb::InstructionSP inst_sp(GetOpaque());
-    if (inst_sp)
-        return inst_sp->DoesBranch ();
-    return false;
-}
-
-bool
-SBInstruction::HasDelaySlot ()
-{
-    lldb::InstructionSP inst_sp(GetOpaque());
-    if (inst_sp)
-        return inst_sp->HasDelaySlot ();
-    return false;
-}
-
-lldb::InstructionSP
-SBInstruction::GetOpaque ()
-{
-    if (m_opaque_sp)
-        return m_opaque_sp->GetSP();
-    else
-        return lldb::InstructionSP();
-}
-
-void
-SBInstruction::SetOpaque (const lldb::DisassemblerSP &disasm_sp, const lldb::InstructionSP& inst_sp)
-{
-    m_opaque_sp.reset(new InstructionImpl(disasm_sp, inst_sp));
-}
-
-bool
-SBInstruction::GetDescription (lldb::SBStream &s)
-{
-    lldb::InstructionSP inst_sp(GetOpaque());
-    if (inst_sp)
-    {
-        SymbolContext sc;
-        const Address &addr = inst_sp->GetAddress();
-        ModuleSP module_sp (addr.GetModule());
-        if (module_sp)
-            module_sp->ResolveSymbolContextForAddress(addr, eSymbolContextEverything, sc);
-        // Use the "ref()" instead of the "get()" accessor in case the SBStream 
-        // didn't have a stream already created, one will get created...
-        FormatEntity::Entry format;
-        FormatEntity::Parse("${addr}: ", format);
-        inst_sp->Dump (&s.ref(), 0, true, false, NULL, &sc, NULL, &format, 0);
-        return true;
-    }
-    return false;
-}
-
-void
-SBInstruction::Print (FILE *out)
-{
-    if (out == NULL)
-        return;
-
-    lldb::InstructionSP inst_sp(GetOpaque());
-    if (inst_sp)
-    {
-        SymbolContext sc;
-        const Address &addr = inst_sp->GetAddress();
-        ModuleSP module_sp (addr.GetModule());
-        if (module_sp)
-            module_sp->ResolveSymbolContextForAddress(addr, eSymbolContextEverything, sc);
-        StreamFile out_stream (out, false);
-        FormatEntity::Entry format;
-        FormatEntity::Parse("${addr}: ", format);
-        inst_sp->Dump (&out_stream, 0, true, false, NULL, &sc, NULL, &format, 0);
-    }
-}
-
-bool
-SBInstruction::EmulateWithFrame (lldb::SBFrame &frame, uint32_t evaluate_options)
-{
-    lldb::InstructionSP inst_sp(GetOpaque());
-    if (inst_sp)
-    {
-        lldb::StackFrameSP frame_sp (frame.GetFrameSP());
-
-        if (frame_sp)
-        {
-            lldb_private::ExecutionContext exe_ctx;
-            frame_sp->CalculateExecutionContext (exe_ctx);
-            lldb_private::Target *target = exe_ctx.GetTargetPtr();
-            lldb_private::ArchSpec arch = target->GetArchitecture();
-            
-            return inst_sp->Emulate(arch,
-                                    evaluate_options,
-                                    (void *) frame_sp.get(),
-                                    &lldb_private::EmulateInstruction::ReadMemoryFrame,
-                                    &lldb_private::EmulateInstruction::WriteMemoryFrame,
-                                    &lldb_private::EmulateInstruction::ReadRegisterFrame,
-                                    &lldb_private::EmulateInstruction::WriteRegisterFrame);
-        }
-    }
-    return false;
-}
-
-bool
-SBInstruction::DumpEmulation (const char *triple)
-{
-    lldb::InstructionSP inst_sp(GetOpaque());
-    if (inst_sp && triple)
-    {
-        lldb_private::ArchSpec arch (triple, NULL);
-        return inst_sp->DumpEmulation (arch);
-    }
-    return false;
-}
+SBInstruction::SBInstruction() : m_opaque_sp() {}
 
-bool
-SBInstruction::TestEmulation (lldb::SBStream &output_stream, const char *test_file)
-{
-    if (!m_opaque_sp)
-        SetOpaque(lldb::DisassemblerSP(), lldb::InstructionSP(new PseudoInstruction()));
-
-    lldb::InstructionSP inst_sp(GetOpaque());
-    if (inst_sp)
-        return inst_sp->TestEmulation (output_stream.get(), test_file);
-    return false;
-}
-
-lldb::AddressClass
-SBInstruction::GetAddressClass ()
-{
-    lldb::InstructionSP inst_sp(GetOpaque());
-    if (inst_sp)
-        return inst_sp->GetAddressClass();
-    return eAddressClassInvalid;
+SBInstruction::SBInstruction(const lldb::DisassemblerSP &disasm_sp,
+                             const lldb::InstructionSP &inst_sp)
+    : m_opaque_sp(new InstructionImpl(disasm_sp, inst_sp)) {}
+
+SBInstruction::SBInstruction(const SBInstruction &rhs)
+    : m_opaque_sp(rhs.m_opaque_sp) {}
+
+const SBInstruction &SBInstruction::operator=(const SBInstruction &rhs) {
+  if (this != &rhs)
+    m_opaque_sp = rhs.m_opaque_sp;
+  return *this;
+}
+
+SBInstruction::~SBInstruction() {}
+
+bool SBInstruction::IsValid() { return m_opaque_sp && m_opaque_sp->IsValid(); }
+
+SBAddress SBInstruction::GetAddress() {
+  SBAddress sb_addr;
+  lldb::InstructionSP inst_sp(GetOpaque());
+  if (inst_sp && inst_sp->GetAddress().IsValid())
+    sb_addr.SetAddress(&inst_sp->GetAddress());
+  return sb_addr;
+}
+
+const char *SBInstruction::GetMnemonic(SBTarget target) {
+  lldb::InstructionSP inst_sp(GetOpaque());
+  if (inst_sp) {
+    ExecutionContext exe_ctx;
+    TargetSP target_sp(target.GetSP());
+    std::unique_lock<std::recursive_mutex> lock;
+    if (target_sp) {
+      lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
+
+      target_sp->CalculateExecutionContext(exe_ctx);
+      exe_ctx.SetProcessSP(target_sp->GetProcessSP());
+    }
+    return inst_sp->GetMnemonic(&exe_ctx);
+  }
+  return NULL;
+}
+
+const char *SBInstruction::GetOperands(SBTarget target) {
+  lldb::InstructionSP inst_sp(GetOpaque());
+  if (inst_sp) {
+    ExecutionContext exe_ctx;
+    TargetSP target_sp(target.GetSP());
+    std::unique_lock<std::recursive_mutex> lock;
+    if (target_sp) {
+      lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
+
+      target_sp->CalculateExecutionContext(exe_ctx);
+      exe_ctx.SetProcessSP(target_sp->GetProcessSP());
+    }
+    return inst_sp->GetOperands(&exe_ctx);
+  }
+  return NULL;
+}
+
+const char *SBInstruction::GetComment(SBTarget target) {
+  lldb::InstructionSP inst_sp(GetOpaque());
+  if (inst_sp) {
+    ExecutionContext exe_ctx;
+    TargetSP target_sp(target.GetSP());
+    std::unique_lock<std::recursive_mutex> lock;
+    if (target_sp) {
+      lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
+
+      target_sp->CalculateExecutionContext(exe_ctx);
+      exe_ctx.SetProcessSP(target_sp->GetProcessSP());
+    }
+    return inst_sp->GetComment(&exe_ctx);
+  }
+  return NULL;
+}
+
+size_t SBInstruction::GetByteSize() {
+  lldb::InstructionSP inst_sp(GetOpaque());
+  if (inst_sp)
+    return inst_sp->GetOpcode().GetByteSize();
+  return 0;
+}
+
+SBData SBInstruction::GetData(SBTarget target) {
+  lldb::SBData sb_data;
+  lldb::InstructionSP inst_sp(GetOpaque());
+  if (inst_sp) {
+    DataExtractorSP data_extractor_sp(new DataExtractor());
+    if (inst_sp->GetData(*data_extractor_sp)) {
+      sb_data.SetOpaque(data_extractor_sp);
+    }
+  }
+  return sb_data;
+}
+
+bool SBInstruction::DoesBranch() {
+  lldb::InstructionSP inst_sp(GetOpaque());
+  if (inst_sp)
+    return inst_sp->DoesBranch();
+  return false;
+}
+
+bool SBInstruction::HasDelaySlot() {
+  lldb::InstructionSP inst_sp(GetOpaque());
+  if (inst_sp)
+    return inst_sp->HasDelaySlot();
+  return false;
+}
+
+lldb::InstructionSP SBInstruction::GetOpaque() {
+  if (m_opaque_sp)
+    return m_opaque_sp->GetSP();
+  else
+    return lldb::InstructionSP();
+}
+
+void SBInstruction::SetOpaque(const lldb::DisassemblerSP &disasm_sp,
+                              const lldb::InstructionSP &inst_sp) {
+  m_opaque_sp.reset(new InstructionImpl(disasm_sp, inst_sp));
+}
+
+bool SBInstruction::GetDescription(lldb::SBStream &s) {
+  lldb::InstructionSP inst_sp(GetOpaque());
+  if (inst_sp) {
+    SymbolContext sc;
+    const Address &addr = inst_sp->GetAddress();
+    ModuleSP module_sp(addr.GetModule());
+    if (module_sp)
+      module_sp->ResolveSymbolContextForAddress(addr, eSymbolContextEverything,
+                                                sc);
+    // Use the "ref()" instead of the "get()" accessor in case the SBStream
+    // didn't have a stream already created, one will get created...
+    FormatEntity::Entry format;
+    FormatEntity::Parse("${addr}: ", format);
+    inst_sp->Dump(&s.ref(), 0, true, false, NULL, &sc, NULL, &format, 0);
+    return true;
+  }
+  return false;
+}
+
+void SBInstruction::Print(FILE *out) {
+  if (out == NULL)
+    return;
+
+  lldb::InstructionSP inst_sp(GetOpaque());
+  if (inst_sp) {
+    SymbolContext sc;
+    const Address &addr = inst_sp->GetAddress();
+    ModuleSP module_sp(addr.GetModule());
+    if (module_sp)
+      module_sp->ResolveSymbolContextForAddress(addr, eSymbolContextEverything,
+                                                sc);
+    StreamFile out_stream(out, false);
+    FormatEntity::Entry format;
+    FormatEntity::Parse("${addr}: ", format);
+    inst_sp->Dump(&out_stream, 0, true, false, NULL, &sc, NULL, &format, 0);
+  }
+}
+
+bool SBInstruction::EmulateWithFrame(lldb::SBFrame &frame,
+                                     uint32_t evaluate_options) {
+  lldb::InstructionSP inst_sp(GetOpaque());
+  if (inst_sp) {
+    lldb::StackFrameSP frame_sp(frame.GetFrameSP());
+
+    if (frame_sp) {
+      lldb_private::ExecutionContext exe_ctx;
+      frame_sp->CalculateExecutionContext(exe_ctx);
+      lldb_private::Target *target = exe_ctx.GetTargetPtr();
+      lldb_private::ArchSpec arch = target->GetArchitecture();
+
+      return inst_sp->Emulate(
+          arch, evaluate_options, (void *)frame_sp.get(),
+          &lldb_private::EmulateInstruction::ReadMemoryFrame,
+          &lldb_private::EmulateInstruction::WriteMemoryFrame,
+          &lldb_private::EmulateInstruction::ReadRegisterFrame,
+          &lldb_private::EmulateInstruction::WriteRegisterFrame);
+    }
+  }
+  return false;
+}
+
+bool SBInstruction::DumpEmulation(const char *triple) {
+  lldb::InstructionSP inst_sp(GetOpaque());
+  if (inst_sp && triple) {
+    lldb_private::ArchSpec arch(triple, NULL);
+    return inst_sp->DumpEmulation(arch);
+  }
+  return false;
+}
+
+bool SBInstruction::TestEmulation(lldb::SBStream &output_stream,
+                                  const char *test_file) {
+  if (!m_opaque_sp)
+    SetOpaque(lldb::DisassemblerSP(),
+              lldb::InstructionSP(new PseudoInstruction()));
+
+  lldb::InstructionSP inst_sp(GetOpaque());
+  if (inst_sp)
+    return inst_sp->TestEmulation(output_stream.get(), test_file);
+  return false;
+}
+
+lldb::AddressClass SBInstruction::GetAddressClass() {
+  lldb::InstructionSP inst_sp(GetOpaque());
+  if (inst_sp)
+    return inst_sp->GetAddressClass();
+  return eAddressClassInvalid;
 }

Modified: lldb/trunk/source/API/SBInstructionList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBInstructionList.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBInstructionList.cpp (original)
+++ lldb/trunk/source/API/SBInstructionList.cpp Tue Sep  6 15:57:50 2016
@@ -18,130 +18,94 @@
 using namespace lldb;
 using namespace lldb_private;
 
+SBInstructionList::SBInstructionList() : m_opaque_sp() {}
 
-SBInstructionList::SBInstructionList () :
-    m_opaque_sp()
-{
-}
-
-SBInstructionList::SBInstructionList(const SBInstructionList &rhs) :
-    m_opaque_sp (rhs.m_opaque_sp)
-{
-}
-
-const SBInstructionList &
-SBInstructionList::operator = (const SBInstructionList &rhs)
-{
-    if (this != &rhs)
-        m_opaque_sp = rhs.m_opaque_sp;
-    return *this;
-}
-
-
-SBInstructionList::~SBInstructionList ()
-{
-}
-
-bool
-SBInstructionList::IsValid () const
-{
-    return m_opaque_sp.get() != NULL;
-}
-
-size_t
-SBInstructionList::GetSize ()
-{
-    if (m_opaque_sp)
-        return m_opaque_sp->GetInstructionList().GetSize();
-    return 0;
-}
-
-SBInstruction
-SBInstructionList::GetInstructionAtIndex (uint32_t idx)
-{
-    SBInstruction inst;
-    if (m_opaque_sp && idx < m_opaque_sp->GetInstructionList().GetSize())
-        inst.SetOpaque (m_opaque_sp, m_opaque_sp->GetInstructionList().GetInstructionAtIndex (idx));
-    return inst;
-}
-
-void
-SBInstructionList::Clear ()
-{
-    m_opaque_sp.reset();
-}
-
-void
-SBInstructionList::AppendInstruction (SBInstruction insn)
-{
-}
-
-void
-SBInstructionList::SetDisassembler (const lldb::DisassemblerSP &opaque_sp)
-{
-    m_opaque_sp = opaque_sp;
-}
-
-void
-SBInstructionList::Print (FILE *out)
-{
-    if (out == NULL)
-        return;
-}
-
-
-bool
-SBInstructionList::GetDescription (lldb::SBStream &description)
-{
-    if (m_opaque_sp)
-    {
-        size_t num_instructions = GetSize ();
-        if (num_instructions)
-        {
-            // Call the ref() to make sure a stream is created if one deesn't 
-            // exist already inside description...
-            Stream &sref = description.ref();
-            const uint32_t max_opcode_byte_size = m_opaque_sp->GetInstructionList().GetMaxOpcocdeByteSize();
-            FormatEntity::Entry format;
-            FormatEntity::Parse("${addr}: ", format);
-            SymbolContext sc;
-            SymbolContext prev_sc;
-            for (size_t i=0; i<num_instructions; ++i)
-            {
-                Instruction *inst = m_opaque_sp->GetInstructionList().GetInstructionAtIndex (i).get();
-                if (inst == NULL)
-                    break;
-
-                const Address &addr = inst->GetAddress();
-                prev_sc = sc;
-                ModuleSP module_sp (addr.GetModule());
-                if (module_sp)
-                {
-                    module_sp->ResolveSymbolContextForAddress(addr, eSymbolContextEverything, sc);
-                }
-
-                inst->Dump (&sref, max_opcode_byte_size, true, false, NULL, &sc, &prev_sc, &format, 0);
-                sref.EOL();
-            }
-            return true;
+SBInstructionList::SBInstructionList(const SBInstructionList &rhs)
+    : m_opaque_sp(rhs.m_opaque_sp) {}
+
+const SBInstructionList &SBInstructionList::
+operator=(const SBInstructionList &rhs) {
+  if (this != &rhs)
+    m_opaque_sp = rhs.m_opaque_sp;
+  return *this;
+}
+
+SBInstructionList::~SBInstructionList() {}
+
+bool SBInstructionList::IsValid() const { return m_opaque_sp.get() != NULL; }
+
+size_t SBInstructionList::GetSize() {
+  if (m_opaque_sp)
+    return m_opaque_sp->GetInstructionList().GetSize();
+  return 0;
+}
+
+SBInstruction SBInstructionList::GetInstructionAtIndex(uint32_t idx) {
+  SBInstruction inst;
+  if (m_opaque_sp && idx < m_opaque_sp->GetInstructionList().GetSize())
+    inst.SetOpaque(
+        m_opaque_sp,
+        m_opaque_sp->GetInstructionList().GetInstructionAtIndex(idx));
+  return inst;
+}
+
+void SBInstructionList::Clear() { m_opaque_sp.reset(); }
+
+void SBInstructionList::AppendInstruction(SBInstruction insn) {}
+
+void SBInstructionList::SetDisassembler(const lldb::DisassemblerSP &opaque_sp) {
+  m_opaque_sp = opaque_sp;
+}
+
+void SBInstructionList::Print(FILE *out) {
+  if (out == NULL)
+    return;
+}
+
+bool SBInstructionList::GetDescription(lldb::SBStream &description) {
+  if (m_opaque_sp) {
+    size_t num_instructions = GetSize();
+    if (num_instructions) {
+      // Call the ref() to make sure a stream is created if one deesn't
+      // exist already inside description...
+      Stream &sref = description.ref();
+      const uint32_t max_opcode_byte_size =
+          m_opaque_sp->GetInstructionList().GetMaxOpcocdeByteSize();
+      FormatEntity::Entry format;
+      FormatEntity::Parse("${addr}: ", format);
+      SymbolContext sc;
+      SymbolContext prev_sc;
+      for (size_t i = 0; i < num_instructions; ++i) {
+        Instruction *inst =
+            m_opaque_sp->GetInstructionList().GetInstructionAtIndex(i).get();
+        if (inst == NULL)
+          break;
+
+        const Address &addr = inst->GetAddress();
+        prev_sc = sc;
+        ModuleSP module_sp(addr.GetModule());
+        if (module_sp) {
+          module_sp->ResolveSymbolContextForAddress(
+              addr, eSymbolContextEverything, sc);
         }
+
+        inst->Dump(&sref, max_opcode_byte_size, true, false, NULL, &sc,
+                   &prev_sc, &format, 0);
+        sref.EOL();
+      }
+      return true;
     }
-    return false;
+  }
+  return false;
 }
 
-
-bool
-SBInstructionList::DumpEmulationForAllInstructions (const char *triple)
-{
-    if (m_opaque_sp)
-    {
-        size_t len = GetSize();
-        for (size_t i = 0; i < len; ++i)
-        {
-            if (!GetInstructionAtIndex((uint32_t) i).DumpEmulation (triple))
-                return false;
-        }
+bool SBInstructionList::DumpEmulationForAllInstructions(const char *triple) {
+  if (m_opaque_sp) {
+    size_t len = GetSize();
+    for (size_t i = 0; i < len; ++i) {
+      if (!GetInstructionAtIndex((uint32_t)i).DumpEmulation(triple))
+        return false;
     }
-    return true;
+  }
+  return true;
 }
-

Modified: lldb/trunk/source/API/SBLanguageRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBLanguageRuntime.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBLanguageRuntime.cpp (original)
+++ lldb/trunk/source/API/SBLanguageRuntime.cpp Tue Sep  6 15:57:50 2016
@@ -14,13 +14,11 @@ using namespace lldb;
 using namespace lldb_private;
 
 lldb::LanguageType
-SBLanguageRuntime::GetLanguageTypeFromString (const char *string)
-{
-    return Language::GetLanguageTypeFromString(string);
+SBLanguageRuntime::GetLanguageTypeFromString(const char *string) {
+  return Language::GetLanguageTypeFromString(string);
 }
 
 const char *
-SBLanguageRuntime::GetNameForLanguageType (lldb::LanguageType language)
-{
-    return Language::GetNameForLanguageType(language);
+SBLanguageRuntime::GetNameForLanguageType(lldb::LanguageType language) {
+  return Language::GetNameForLanguageType(language);
 }

Modified: lldb/trunk/source/API/SBLaunchInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBLaunchInfo.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBLaunchInfo.cpp (original)
+++ lldb/trunk/source/API/SBLaunchInfo.cpp Tue Sep  6 15:57:50 2016
@@ -16,279 +16,175 @@
 using namespace lldb;
 using namespace lldb_private;
 
-SBLaunchInfo::SBLaunchInfo (const char **argv) :
-    m_opaque_sp(new ProcessLaunchInfo())
-{
-    m_opaque_sp->GetFlags().Reset (eLaunchFlagDebug | eLaunchFlagDisableASLR);
-    if (argv && argv[0])
-        m_opaque_sp->GetArguments().SetArguments(argv);
+SBLaunchInfo::SBLaunchInfo(const char **argv)
+    : m_opaque_sp(new ProcessLaunchInfo()) {
+  m_opaque_sp->GetFlags().Reset(eLaunchFlagDebug | eLaunchFlagDisableASLR);
+  if (argv && argv[0])
+    m_opaque_sp->GetArguments().SetArguments(argv);
 }
 
-SBLaunchInfo::~SBLaunchInfo()
-{
-}
+SBLaunchInfo::~SBLaunchInfo() {}
 
-lldb_private::ProcessLaunchInfo &
-SBLaunchInfo::ref ()
-{
-    return *m_opaque_sp;
-}
+lldb_private::ProcessLaunchInfo &SBLaunchInfo::ref() { return *m_opaque_sp; }
 
-const lldb_private::ProcessLaunchInfo &
-SBLaunchInfo::ref () const
-{
-    return *m_opaque_sp;
+const lldb_private::ProcessLaunchInfo &SBLaunchInfo::ref() const {
+  return *m_opaque_sp;
 }
 
-lldb::pid_t
-SBLaunchInfo::GetProcessID()
-{
-    return m_opaque_sp->GetProcessID();
-}
+lldb::pid_t SBLaunchInfo::GetProcessID() { return m_opaque_sp->GetProcessID(); }
 
-uint32_t
-SBLaunchInfo::GetUserID()
-{
-    return m_opaque_sp->GetUserID();
-}
+uint32_t SBLaunchInfo::GetUserID() { return m_opaque_sp->GetUserID(); }
 
-uint32_t
-SBLaunchInfo::GetGroupID()
-{
-    return m_opaque_sp->GetGroupID();
-}
+uint32_t SBLaunchInfo::GetGroupID() { return m_opaque_sp->GetGroupID(); }
 
-bool
-SBLaunchInfo::UserIDIsValid ()
-{
-    return m_opaque_sp->UserIDIsValid();
-}
+bool SBLaunchInfo::UserIDIsValid() { return m_opaque_sp->UserIDIsValid(); }
 
-bool
-SBLaunchInfo::GroupIDIsValid ()
-{
-    return m_opaque_sp->GroupIDIsValid();
+bool SBLaunchInfo::GroupIDIsValid() { return m_opaque_sp->GroupIDIsValid(); }
+
+void SBLaunchInfo::SetUserID(uint32_t uid) { m_opaque_sp->SetUserID(uid); }
+
+void SBLaunchInfo::SetGroupID(uint32_t gid) { m_opaque_sp->SetGroupID(gid); }
+
+SBFileSpec SBLaunchInfo::GetExecutableFile() {
+  return SBFileSpec(m_opaque_sp->GetExecutableFile());
 }
 
-void
-SBLaunchInfo::SetUserID (uint32_t uid)
-{
-    m_opaque_sp->SetUserID (uid);
+void SBLaunchInfo::SetExecutableFile(SBFileSpec exe_file,
+                                     bool add_as_first_arg) {
+  m_opaque_sp->SetExecutableFile(exe_file.ref(), add_as_first_arg);
 }
 
-void
-SBLaunchInfo::SetGroupID (uint32_t gid)
-{
-    m_opaque_sp->SetGroupID (gid);
+SBListener SBLaunchInfo::GetListener() {
+  return SBListener(m_opaque_sp->GetListener());
 }
 
-SBFileSpec
-SBLaunchInfo::GetExecutableFile ()
-{
-    return SBFileSpec (m_opaque_sp->GetExecutableFile());
+void SBLaunchInfo::SetListener(SBListener &listener) {
+  m_opaque_sp->SetListener(listener.GetSP());
 }
 
-void
-SBLaunchInfo::SetExecutableFile (SBFileSpec exe_file, bool add_as_first_arg)
-{
-    m_opaque_sp->SetExecutableFile(exe_file.ref(), add_as_first_arg);
+uint32_t SBLaunchInfo::GetNumArguments() {
+  return m_opaque_sp->GetArguments().GetArgumentCount();
 }
 
-SBListener
-SBLaunchInfo::GetListener ()
-{
-    return SBListener(m_opaque_sp->GetListener());
+const char *SBLaunchInfo::GetArgumentAtIndex(uint32_t idx) {
+  return m_opaque_sp->GetArguments().GetArgumentAtIndex(idx);
 }
 
-void
-SBLaunchInfo::SetListener (SBListener &listener)
-{
-    m_opaque_sp->SetListener(listener.GetSP());
+void SBLaunchInfo::SetArguments(const char **argv, bool append) {
+  if (append) {
+    if (argv)
+      m_opaque_sp->GetArguments().AppendArguments(argv);
+  } else {
+    if (argv)
+      m_opaque_sp->GetArguments().SetArguments(argv);
+    else
+      m_opaque_sp->GetArguments().Clear();
+  }
 }
 
-uint32_t
-SBLaunchInfo::GetNumArguments ()
-{
-    return m_opaque_sp->GetArguments().GetArgumentCount();
+uint32_t SBLaunchInfo::GetNumEnvironmentEntries() {
+  return m_opaque_sp->GetEnvironmentEntries().GetArgumentCount();
 }
 
-const char *
-SBLaunchInfo::GetArgumentAtIndex (uint32_t idx)
-{
-    return m_opaque_sp->GetArguments().GetArgumentAtIndex(idx);
+const char *SBLaunchInfo::GetEnvironmentEntryAtIndex(uint32_t idx) {
+  return m_opaque_sp->GetEnvironmentEntries().GetArgumentAtIndex(idx);
 }
 
-void
-SBLaunchInfo::SetArguments (const char **argv, bool append)
-{
-    if (append)
-    {
-        if (argv)
-            m_opaque_sp->GetArguments().AppendArguments(argv);
-    }
-    else
-    {
-        if (argv)
-            m_opaque_sp->GetArguments().SetArguments(argv);
-        else
-            m_opaque_sp->GetArguments().Clear();
-    }
-}
-
-uint32_t
-SBLaunchInfo::GetNumEnvironmentEntries ()
-{
-    return m_opaque_sp->GetEnvironmentEntries().GetArgumentCount();
-}
-
-const char *
-SBLaunchInfo::GetEnvironmentEntryAtIndex (uint32_t idx)
-{
-    return m_opaque_sp->GetEnvironmentEntries().GetArgumentAtIndex(idx);
-}
-
-void
-SBLaunchInfo::SetEnvironmentEntries (const char **envp, bool append)
-{
-    if (append)
-    {
-        if (envp)
-            m_opaque_sp->GetEnvironmentEntries().AppendArguments(envp);
-    }
+void SBLaunchInfo::SetEnvironmentEntries(const char **envp, bool append) {
+  if (append) {
+    if (envp)
+      m_opaque_sp->GetEnvironmentEntries().AppendArguments(envp);
+  } else {
+    if (envp)
+      m_opaque_sp->GetEnvironmentEntries().SetArguments(envp);
     else
-    {
-        if (envp)
-            m_opaque_sp->GetEnvironmentEntries().SetArguments(envp);
-        else
-            m_opaque_sp->GetEnvironmentEntries().Clear();
-    }
+      m_opaque_sp->GetEnvironmentEntries().Clear();
+  }
 }
 
-void
-SBLaunchInfo::Clear ()
-{
-    m_opaque_sp->Clear();
-}
+void SBLaunchInfo::Clear() { m_opaque_sp->Clear(); }
 
-const char *
-SBLaunchInfo::GetWorkingDirectory () const
-{
-    return m_opaque_sp->GetWorkingDirectory().GetCString();
+const char *SBLaunchInfo::GetWorkingDirectory() const {
+  return m_opaque_sp->GetWorkingDirectory().GetCString();
 }
 
-void
-SBLaunchInfo::SetWorkingDirectory (const char *working_dir)
-{
-    m_opaque_sp->SetWorkingDirectory(FileSpec{working_dir, false});
+void SBLaunchInfo::SetWorkingDirectory(const char *working_dir) {
+  m_opaque_sp->SetWorkingDirectory(FileSpec{working_dir, false});
 }
 
-uint32_t
-SBLaunchInfo::GetLaunchFlags ()
-{
-    return m_opaque_sp->GetFlags().Get();
+uint32_t SBLaunchInfo::GetLaunchFlags() {
+  return m_opaque_sp->GetFlags().Get();
 }
 
-void
-SBLaunchInfo::SetLaunchFlags (uint32_t flags)
-{
-    m_opaque_sp->GetFlags().Reset(flags);
+void SBLaunchInfo::SetLaunchFlags(uint32_t flags) {
+  m_opaque_sp->GetFlags().Reset(flags);
 }
 
-const char *
-SBLaunchInfo::GetProcessPluginName ()
-{
-    return m_opaque_sp->GetProcessPluginName();
+const char *SBLaunchInfo::GetProcessPluginName() {
+  return m_opaque_sp->GetProcessPluginName();
 }
 
-void
-SBLaunchInfo::SetProcessPluginName (const char *plugin_name)
-{
-    return m_opaque_sp->SetProcessPluginName (plugin_name);
+void SBLaunchInfo::SetProcessPluginName(const char *plugin_name) {
+  return m_opaque_sp->SetProcessPluginName(plugin_name);
 }
 
-const char *
-SBLaunchInfo::GetShell ()
-{
-    // Constify this string so that it is saved in the string pool.  Otherwise
-    // it would be freed when this function goes out of scope.
-    ConstString shell(m_opaque_sp->GetShell().GetPath().c_str());
-    return shell.AsCString();
+const char *SBLaunchInfo::GetShell() {
+  // Constify this string so that it is saved in the string pool.  Otherwise
+  // it would be freed when this function goes out of scope.
+  ConstString shell(m_opaque_sp->GetShell().GetPath().c_str());
+  return shell.AsCString();
 }
 
-void
-SBLaunchInfo::SetShell (const char * path)
-{
-    m_opaque_sp->SetShell (FileSpec(path, false));
+void SBLaunchInfo::SetShell(const char *path) {
+  m_opaque_sp->SetShell(FileSpec(path, false));
 }
 
-bool
-SBLaunchInfo::GetShellExpandArguments ()
-{
-    return m_opaque_sp->GetShellExpandArguments();
+bool SBLaunchInfo::GetShellExpandArguments() {
+  return m_opaque_sp->GetShellExpandArguments();
 }
 
-void
-SBLaunchInfo::SetShellExpandArguments (bool expand)
-{
-    m_opaque_sp->SetShellExpandArguments(expand);
+void SBLaunchInfo::SetShellExpandArguments(bool expand) {
+  m_opaque_sp->SetShellExpandArguments(expand);
 }
 
-uint32_t
-SBLaunchInfo::GetResumeCount ()
-{
-    return m_opaque_sp->GetResumeCount();
+uint32_t SBLaunchInfo::GetResumeCount() {
+  return m_opaque_sp->GetResumeCount();
 }
 
-void
-SBLaunchInfo::SetResumeCount (uint32_t c)
-{
-    m_opaque_sp->SetResumeCount (c);
+void SBLaunchInfo::SetResumeCount(uint32_t c) {
+  m_opaque_sp->SetResumeCount(c);
 }
 
-bool
-SBLaunchInfo::AddCloseFileAction (int fd)
-{
-    return m_opaque_sp->AppendCloseFileAction(fd);
+bool SBLaunchInfo::AddCloseFileAction(int fd) {
+  return m_opaque_sp->AppendCloseFileAction(fd);
 }
 
-bool
-SBLaunchInfo::AddDuplicateFileAction (int fd, int dup_fd)
-{
-    return m_opaque_sp->AppendDuplicateFileAction(fd, dup_fd);
+bool SBLaunchInfo::AddDuplicateFileAction(int fd, int dup_fd) {
+  return m_opaque_sp->AppendDuplicateFileAction(fd, dup_fd);
 }
 
-bool
-SBLaunchInfo::AddOpenFileAction (int fd, const char *path, bool read, bool write)
-{
-    return m_opaque_sp->AppendOpenFileAction(fd, FileSpec{path, false}, read, write);
+bool SBLaunchInfo::AddOpenFileAction(int fd, const char *path, bool read,
+                                     bool write) {
+  return m_opaque_sp->AppendOpenFileAction(fd, FileSpec{path, false}, read,
+                                           write);
 }
 
-bool
-SBLaunchInfo::AddSuppressFileAction (int fd, bool read, bool write)
-{
-    return m_opaque_sp->AppendSuppressFileAction(fd, read, write);
+bool SBLaunchInfo::AddSuppressFileAction(int fd, bool read, bool write) {
+  return m_opaque_sp->AppendSuppressFileAction(fd, read, write);
 }
 
-void
-SBLaunchInfo::SetLaunchEventData (const char *data)
-{
-    m_opaque_sp->SetLaunchEventData (data);
+void SBLaunchInfo::SetLaunchEventData(const char *data) {
+  m_opaque_sp->SetLaunchEventData(data);
 }
 
-const char *
-SBLaunchInfo::GetLaunchEventData () const
-{
-    return m_opaque_sp->GetLaunchEventData ();
+const char *SBLaunchInfo::GetLaunchEventData() const {
+  return m_opaque_sp->GetLaunchEventData();
 }
 
-void
-SBLaunchInfo::SetDetachOnError (bool enable)
-{
-    m_opaque_sp->SetDetachOnError (enable);
+void SBLaunchInfo::SetDetachOnError(bool enable) {
+  m_opaque_sp->SetDetachOnError(enable);
 }
 
-bool
-SBLaunchInfo::GetDetachOnError () const
-{
-    return m_opaque_sp->GetDetachOnError ();
+bool SBLaunchInfo::GetDetachOnError() const {
+  return m_opaque_sp->GetDetachOnError();
 }

Modified: lldb/trunk/source/API/SBLineEntry.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBLineEntry.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBLineEntry.cpp (original)
+++ lldb/trunk/source/API/SBLineEntry.cpp Tue Sep  6 15:57:50 2016
@@ -11,244 +11,179 @@
 
 #include "lldb/API/SBLineEntry.h"
 #include "lldb/API/SBStream.h"
-#include "lldb/Core/StreamString.h"
 #include "lldb/Core/Log.h"
+#include "lldb/Core/StreamString.h"
 #include "lldb/Symbol/LineEntry.h"
 
 using namespace lldb;
 using namespace lldb_private;
 
+SBLineEntry::SBLineEntry() : m_opaque_ap() {}
 
-SBLineEntry::SBLineEntry () :
-    m_opaque_ap ()
-{
+SBLineEntry::SBLineEntry(const SBLineEntry &rhs) : m_opaque_ap() {
+  if (rhs.IsValid())
+    ref() = rhs.ref();
 }
 
-SBLineEntry::SBLineEntry (const SBLineEntry &rhs) :
-    m_opaque_ap ()
-{
-    if (rhs.IsValid())
-        ref() = rhs.ref();
+SBLineEntry::SBLineEntry(const lldb_private::LineEntry *lldb_object_ptr)
+    : m_opaque_ap() {
+  if (lldb_object_ptr)
+    ref() = *lldb_object_ptr;
 }
 
-SBLineEntry::SBLineEntry (const lldb_private::LineEntry *lldb_object_ptr) :
-    m_opaque_ap ()
-{
-    if (lldb_object_ptr)
-        ref() = *lldb_object_ptr;
-}
-
-const SBLineEntry &
-SBLineEntry::operator = (const SBLineEntry &rhs)
-{
-    if (this != &rhs)
-    {
-        if (rhs.IsValid())
-            ref() = rhs.ref();
-        else
-            m_opaque_ap.reset();
-    }
-    return *this;
-}
-
-void
-SBLineEntry::SetLineEntry (const lldb_private::LineEntry &lldb_object_ref)
-{
-    ref() = lldb_object_ref;
-}
-
-
-SBLineEntry::~SBLineEntry ()
-{
-}
-
-
-SBAddress
-SBLineEntry::GetStartAddress () const
-{
-    SBAddress sb_address;
-    if (m_opaque_ap.get())
-        sb_address.SetAddress(&m_opaque_ap->range.GetBaseAddress());
-
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-    {
-        StreamString sstr;
-        const Address *addr = sb_address.get();
-        if (addr)
-            addr->Dump (&sstr, NULL, Address::DumpStyleModuleWithFileAddress, Address::DumpStyleInvalid, 4);
-        log->Printf ("SBLineEntry(%p)::GetStartAddress () => SBAddress (%p): %s",
-                     static_cast<void*>(m_opaque_ap.get()),
-                     static_cast<void*>(sb_address.get()), sstr.GetData());
-    }
-
-    return sb_address;
-}
-
-SBAddress
-SBLineEntry::GetEndAddress () const
-{
-    SBAddress sb_address;
-    if (m_opaque_ap.get())
-    {
-        sb_address.SetAddress(&m_opaque_ap->range.GetBaseAddress());
-        sb_address.OffsetAddress(m_opaque_ap->range.GetByteSize());
-    }
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-    {
-        StreamString sstr;
-        const Address *addr = sb_address.get();
-        if (addr)
-            addr->Dump (&sstr, NULL, Address::DumpStyleModuleWithFileAddress, Address::DumpStyleInvalid, 4);
-        log->Printf ("SBLineEntry(%p)::GetEndAddress () => SBAddress (%p): %s",
-                     static_cast<void*>(m_opaque_ap.get()),
-                     static_cast<void*>(sb_address.get()), sstr.GetData());
-    }
-    return sb_address;
-}
-
-bool
-SBLineEntry::IsValid () const
-{
-    return m_opaque_ap.get() && m_opaque_ap->IsValid();
-}
-
-
-SBFileSpec
-SBLineEntry::GetFileSpec () const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    SBFileSpec sb_file_spec;
-    if (m_opaque_ap.get() && m_opaque_ap->file)
-        sb_file_spec.SetFileSpec(m_opaque_ap->file);
-
-    if (log)
-    {
-        SBStream sstr;
-        sb_file_spec.GetDescription (sstr);
-        log->Printf ("SBLineEntry(%p)::GetFileSpec () => SBFileSpec(%p): %s",
-                     static_cast<void*>(m_opaque_ap.get()),
-                     static_cast<const void*>(sb_file_spec.get()),
-                     sstr.GetData());
-    }
-
-    return sb_file_spec;
-}
-
-uint32_t
-SBLineEntry::GetLine () const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    uint32_t line = 0;
-    if (m_opaque_ap.get())
-        line = m_opaque_ap->line;
-
-    if (log)
-        log->Printf ("SBLineEntry(%p)::GetLine () => %u",
-                     static_cast<void*>(m_opaque_ap.get()), line);
-
-    return line;
-}
-
-
-uint32_t
-SBLineEntry::GetColumn () const
-{
-    if (m_opaque_ap.get())
-        return m_opaque_ap->column;
-    return 0;
-}
-
-void
-SBLineEntry::SetFileSpec (lldb::SBFileSpec filespec)
-{
-    if (filespec.IsValid())
-        ref().file = filespec.ref();
+const SBLineEntry &SBLineEntry::operator=(const SBLineEntry &rhs) {
+  if (this != &rhs) {
+    if (rhs.IsValid())
+      ref() = rhs.ref();
     else
-        ref().file.Clear();
+      m_opaque_ap.reset();
+  }
+  return *this;
+}
+
+void SBLineEntry::SetLineEntry(const lldb_private::LineEntry &lldb_object_ref) {
+  ref() = lldb_object_ref;
 }
-void
-SBLineEntry::SetLine (uint32_t line)
-{
-    ref().line = line;
+
+SBLineEntry::~SBLineEntry() {}
+
+SBAddress SBLineEntry::GetStartAddress() const {
+  SBAddress sb_address;
+  if (m_opaque_ap.get())
+    sb_address.SetAddress(&m_opaque_ap->range.GetBaseAddress());
+
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log) {
+    StreamString sstr;
+    const Address *addr = sb_address.get();
+    if (addr)
+      addr->Dump(&sstr, NULL, Address::DumpStyleModuleWithFileAddress,
+                 Address::DumpStyleInvalid, 4);
+    log->Printf("SBLineEntry(%p)::GetStartAddress () => SBAddress (%p): %s",
+                static_cast<void *>(m_opaque_ap.get()),
+                static_cast<void *>(sb_address.get()), sstr.GetData());
+  }
+
+  return sb_address;
 }
 
-void
-SBLineEntry::SetColumn (uint32_t column)
-{
-    ref().line = column;
+SBAddress SBLineEntry::GetEndAddress() const {
+  SBAddress sb_address;
+  if (m_opaque_ap.get()) {
+    sb_address.SetAddress(&m_opaque_ap->range.GetBaseAddress());
+    sb_address.OffsetAddress(m_opaque_ap->range.GetByteSize());
+  }
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log) {
+    StreamString sstr;
+    const Address *addr = sb_address.get();
+    if (addr)
+      addr->Dump(&sstr, NULL, Address::DumpStyleModuleWithFileAddress,
+                 Address::DumpStyleInvalid, 4);
+    log->Printf("SBLineEntry(%p)::GetEndAddress () => SBAddress (%p): %s",
+                static_cast<void *>(m_opaque_ap.get()),
+                static_cast<void *>(sb_address.get()), sstr.GetData());
+  }
+  return sb_address;
 }
 
+bool SBLineEntry::IsValid() const {
+  return m_opaque_ap.get() && m_opaque_ap->IsValid();
+}
 
+SBFileSpec SBLineEntry::GetFileSpec() const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-bool
-SBLineEntry::operator == (const SBLineEntry &rhs) const
-{
-    lldb_private::LineEntry *lhs_ptr = m_opaque_ap.get();
-    lldb_private::LineEntry *rhs_ptr = rhs.m_opaque_ap.get();
+  SBFileSpec sb_file_spec;
+  if (m_opaque_ap.get() && m_opaque_ap->file)
+    sb_file_spec.SetFileSpec(m_opaque_ap->file);
 
-    if (lhs_ptr && rhs_ptr)
-        return lldb_private::LineEntry::Compare (*lhs_ptr, *rhs_ptr) == 0;
+  if (log) {
+    SBStream sstr;
+    sb_file_spec.GetDescription(sstr);
+    log->Printf("SBLineEntry(%p)::GetFileSpec () => SBFileSpec(%p): %s",
+                static_cast<void *>(m_opaque_ap.get()),
+                static_cast<const void *>(sb_file_spec.get()), sstr.GetData());
+  }
 
-    return lhs_ptr == rhs_ptr;
+  return sb_file_spec;
 }
 
-bool
-SBLineEntry::operator != (const SBLineEntry &rhs) const
-{
-    lldb_private::LineEntry *lhs_ptr = m_opaque_ap.get();
-    lldb_private::LineEntry *rhs_ptr = rhs.m_opaque_ap.get();
+uint32_t SBLineEntry::GetLine() const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  uint32_t line = 0;
+  if (m_opaque_ap.get())
+    line = m_opaque_ap->line;
 
-    if (lhs_ptr && rhs_ptr)
-        return lldb_private::LineEntry::Compare (*lhs_ptr, *rhs_ptr) != 0;
+  if (log)
+    log->Printf("SBLineEntry(%p)::GetLine () => %u",
+                static_cast<void *>(m_opaque_ap.get()), line);
 
-    return lhs_ptr != rhs_ptr;
+  return line;
 }
 
-const lldb_private::LineEntry *
-SBLineEntry::operator->() const
-{
-    return m_opaque_ap.get();
+uint32_t SBLineEntry::GetColumn() const {
+  if (m_opaque_ap.get())
+    return m_opaque_ap->column;
+  return 0;
 }
 
-lldb_private::LineEntry &
-SBLineEntry::ref()
-{
-    if (m_opaque_ap.get() == NULL)
-        m_opaque_ap.reset (new lldb_private::LineEntry ());
-    return *m_opaque_ap;
+void SBLineEntry::SetFileSpec(lldb::SBFileSpec filespec) {
+  if (filespec.IsValid())
+    ref().file = filespec.ref();
+  else
+    ref().file.Clear();
 }
+void SBLineEntry::SetLine(uint32_t line) { ref().line = line; }
 
-const lldb_private::LineEntry &
-SBLineEntry::ref() const
-{
-    return *m_opaque_ap;
+void SBLineEntry::SetColumn(uint32_t column) { ref().line = column; }
+
+bool SBLineEntry::operator==(const SBLineEntry &rhs) const {
+  lldb_private::LineEntry *lhs_ptr = m_opaque_ap.get();
+  lldb_private::LineEntry *rhs_ptr = rhs.m_opaque_ap.get();
+
+  if (lhs_ptr && rhs_ptr)
+    return lldb_private::LineEntry::Compare(*lhs_ptr, *rhs_ptr) == 0;
+
+  return lhs_ptr == rhs_ptr;
 }
 
-bool
-SBLineEntry::GetDescription (SBStream &description)
-{
-    Stream &strm = description.ref();
+bool SBLineEntry::operator!=(const SBLineEntry &rhs) const {
+  lldb_private::LineEntry *lhs_ptr = m_opaque_ap.get();
+  lldb_private::LineEntry *rhs_ptr = rhs.m_opaque_ap.get();
 
-    if (m_opaque_ap.get())
-    {
-        char file_path[PATH_MAX*2];
-        m_opaque_ap->file.GetPath (file_path, sizeof (file_path));
-        strm.Printf ("%s:%u", file_path, GetLine());
-        if (GetColumn() > 0)
-            strm.Printf (":%u", GetColumn());
-    }
-    else
-        strm.PutCString ("No value");
+  if (lhs_ptr && rhs_ptr)
+    return lldb_private::LineEntry::Compare(*lhs_ptr, *rhs_ptr) != 0;
+
+  return lhs_ptr != rhs_ptr;
+}
 
-    return true;
+const lldb_private::LineEntry *SBLineEntry::operator->() const {
+  return m_opaque_ap.get();
 }
 
-lldb_private::LineEntry *
-SBLineEntry::get ()
-{
-    return m_opaque_ap.get();
+lldb_private::LineEntry &SBLineEntry::ref() {
+  if (m_opaque_ap.get() == NULL)
+    m_opaque_ap.reset(new lldb_private::LineEntry());
+  return *m_opaque_ap;
 }
+
+const lldb_private::LineEntry &SBLineEntry::ref() const { return *m_opaque_ap; }
+
+bool SBLineEntry::GetDescription(SBStream &description) {
+  Stream &strm = description.ref();
+
+  if (m_opaque_ap.get()) {
+    char file_path[PATH_MAX * 2];
+    m_opaque_ap->file.GetPath(file_path, sizeof(file_path));
+    strm.Printf("%s:%u", file_path, GetLine());
+    if (GetColumn() > 0)
+      strm.Printf(":%u", GetColumn());
+  } else
+    strm.PutCString("No value");
+
+  return true;
+}
+
+lldb_private::LineEntry *SBLineEntry::get() { return m_opaque_ap.get(); }

Modified: lldb/trunk/source/API/SBListener.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBListener.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBListener.cpp (original)
+++ lldb/trunk/source/API/SBListener.cpp Tue Sep  6 15:57:50 2016
@@ -18,390 +18,293 @@
 #include "lldb/Core/Log.h"
 #include "lldb/Core/StreamString.h"
 
-
 using namespace lldb;
 using namespace lldb_private;
 
+SBListener::SBListener() : m_opaque_sp(), m_unused_ptr(NULL) {}
 
-SBListener::SBListener () :
-    m_opaque_sp (),
-    m_unused_ptr (NULL)
-{
-}
-
-SBListener::SBListener (const char *name) :
-    m_opaque_sp (Listener::MakeListener(name)),
-    m_unused_ptr (nullptr)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    if (log)
-        log->Printf ("SBListener::SBListener (name=\"%s\") => SBListener(%p)",
-                     name, static_cast<void*>(m_opaque_sp.get()));
-}
-
-
-SBListener::SBListener (const SBListener &rhs) :
-    m_opaque_sp (rhs.m_opaque_sp),
-    m_unused_ptr (nullptr)
-{
-}
-
-const lldb::SBListener &
-SBListener::operator = (const lldb::SBListener &rhs)
-{
-    if (this != &rhs)
-    {
-        m_opaque_sp = rhs.m_opaque_sp;
-        m_unused_ptr = nullptr;
-    }
-    return *this;
-}
-
-SBListener::SBListener (const lldb::ListenerSP &listener_sp) :
-    m_opaque_sp (listener_sp),
-    m_unused_ptr (nullptr)
-{
-}
-
-SBListener::~SBListener ()
-{
-}
-
-bool
-SBListener::IsValid() const
-{
-    return m_opaque_sp != nullptr;
-}
-
-void
-SBListener::AddEvent (const SBEvent &event)
-{
-    EventSP &event_sp = event.GetSP ();
-    if (event_sp)
-        m_opaque_sp->AddEvent (event_sp);
-}
-
-void
-SBListener::Clear ()
-{
-    if (m_opaque_sp)
-        m_opaque_sp->Clear ();
-}
-
-uint32_t
-SBListener::StartListeningForEventClass (SBDebugger &debugger,
-                             const char *broadcaster_class, 
-                             uint32_t event_mask)
-{
-    if (m_opaque_sp)
-    {
-        Debugger *lldb_debugger = debugger.get();
-        if (!lldb_debugger)
-            return 0;
-        BroadcastEventSpec event_spec (ConstString (broadcaster_class), event_mask);
-        return m_opaque_sp->StartListeningForEventSpec (lldb_debugger->GetBroadcasterManager(), event_spec);
-    }
-    else
-        return 0;
-}
-
-bool
-SBListener::StopListeningForEventClass (SBDebugger &debugger,
-                            const char *broadcaster_class,
-                            uint32_t event_mask)
-{
-    if (m_opaque_sp)
-    {
-        Debugger *lldb_debugger = debugger.get();
-        if (!lldb_debugger)
-            return false;
-        BroadcastEventSpec event_spec (ConstString (broadcaster_class), event_mask);
-        return m_opaque_sp->StopListeningForEventSpec (lldb_debugger->GetBroadcasterManager(), event_spec);
-    }
-    else
-        return false;
-}
-
-uint32_t
-SBListener::StartListeningForEvents (const SBBroadcaster& broadcaster, uint32_t event_mask)
-{
-    uint32_t acquired_event_mask = 0;
-    if (m_opaque_sp && broadcaster.IsValid())
-    {
-        acquired_event_mask = m_opaque_sp->StartListeningForEvents (broadcaster.get(), event_mask);
-    }
-
-    Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
-    if (log)
-    {
-        StreamString sstr_requested;
-        StreamString sstr_acquired;
-
-        Broadcaster *lldb_broadcaster = broadcaster.get();
-        if (lldb_broadcaster)
-        {
-            const bool got_requested_names = lldb_broadcaster->GetEventNames (sstr_requested, event_mask, false);
-            const bool got_acquired_names = lldb_broadcaster->GetEventNames (sstr_acquired, acquired_event_mask, false);
-            log->Printf ("SBListener(%p)::StartListeneingForEvents (SBBroadcaster(%p): %s, event_mask=0x%8.8x%s%s%s) => 0x%8.8x%s%s%s",
-                         static_cast<void*>(m_opaque_sp.get()),
-                         static_cast<void*>(lldb_broadcaster),
-                         lldb_broadcaster->GetBroadcasterName().GetCString(),
-                         event_mask,
-                         got_requested_names ? " (" : "",
-                         sstr_requested.GetData(),
-                         got_requested_names ? ")" : "",
-                         acquired_event_mask,
-                         got_acquired_names ? " (" : "",
-                         sstr_acquired.GetData(),
-                         got_acquired_names ? ")" : "");
-        }
-        else
-        {
-            log->Printf ("SBListener(%p)::StartListeneingForEvents (SBBroadcaster(%p), event_mask=0x%8.8x) => 0x%8.8x",
-                         static_cast<void*>(m_opaque_sp.get()),
-                         static_cast<void*>(lldb_broadcaster), event_mask,
-                         acquired_event_mask);
-        }
-    }
-
-    return acquired_event_mask;
-}
-
-bool
-SBListener::StopListeningForEvents (const SBBroadcaster& broadcaster, uint32_t event_mask)
-{
-    if (m_opaque_sp && broadcaster.IsValid())
-    {
-        return m_opaque_sp->StopListeningForEvents (broadcaster.get(), event_mask);
-    }
-    return false;
-}
-
-bool
-SBListener::WaitForEvent (uint32_t timeout_secs, SBEvent &event)
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (log)
-    {
-        if (timeout_secs == UINT32_MAX)
-        {
-            log->Printf ("SBListener(%p)::WaitForEvent (timeout_secs=INFINITE, SBEvent(%p))...",
-                         static_cast<void*>(m_opaque_sp.get()),
-                         static_cast<void*>(event.get()));
-        }
-        else
-        {
-            log->Printf ("SBListener(%p)::WaitForEvent (timeout_secs=%d, SBEvent(%p))...",
-                         static_cast<void*>(m_opaque_sp.get()), timeout_secs,
-                         static_cast<void*>(event.get()));
-        }
-    }
-    bool success = false;
-
-    if (m_opaque_sp)
-    {
-        std::chrono::microseconds timeout = std::chrono::microseconds(0);
-        if (timeout_secs != UINT32_MAX)
-        {
-            assert (timeout_secs != 0); // Take this out after all calls with timeout set to zero have been removed....
-            timeout = std::chrono::seconds(timeout_secs);
-        }
-        EventSP event_sp;
-        if (m_opaque_sp->WaitForEvent(timeout, event_sp))
-        {
-            event.reset (event_sp);
-            success = true;
-        }
-    }
-
-    if (log)
-    {
-        if (timeout_secs == UINT32_MAX)
-        {
-            log->Printf ("SBListener(%p)::WaitForEvent (timeout_secs=INFINITE, SBEvent(%p)) => %i",
-                         static_cast<void*>(m_opaque_sp.get()),
-                         static_cast<void*>(event.get()), success);
-        }
-        else
-        {
-            log->Printf ("SBListener(%p)::WaitForEvent (timeout_secs=%d, SBEvent(%p)) => %i",
-                         static_cast<void*>(m_opaque_sp.get()), timeout_secs,
-                         static_cast<void*>(event.get()), success);
-        }
-    }
-    if (!success)
-        event.reset (NULL);
-    return success;
-}
-
-bool
-SBListener::WaitForEventForBroadcaster
-(
-    uint32_t num_seconds,
-    const SBBroadcaster &broadcaster,
-    SBEvent &event
-)
-{
-    if (m_opaque_sp && broadcaster.IsValid())
-    {
-        std::chrono::microseconds timeout = std::chrono::microseconds(0);
-        if (num_seconds != UINT32_MAX)
-            timeout = std::chrono::seconds(num_seconds);
-        EventSP event_sp;
-        if (m_opaque_sp->WaitForEventForBroadcaster(timeout, broadcaster.get(), event_sp))
-        {
-            event.reset (event_sp);
-            return true;
-        }
-
-    }
-    event.reset (NULL);
-    return false;
-}
-
-bool
-SBListener::WaitForEventForBroadcasterWithType
-(
-    uint32_t num_seconds,
-    const SBBroadcaster &broadcaster,
-    uint32_t event_type_mask,
-    SBEvent &event
-)
-{
-    if (m_opaque_sp && broadcaster.IsValid())
-    {
-        std::chrono::microseconds timeout = std::chrono::microseconds(0);
-        if (num_seconds != UINT32_MAX)
-            timeout = std::chrono::seconds(num_seconds);
-        EventSP event_sp;
-        if (m_opaque_sp->WaitForEventForBroadcasterWithType(timeout, broadcaster.get(), event_type_mask, event_sp))
-        {
-            event.reset (event_sp);
-            return true;
-        }
-    }
-    event.reset (NULL);
-    return false;
-}
-
-bool
-SBListener::PeekAtNextEvent (SBEvent &event)
-{
-    if (m_opaque_sp)
-    {
-        event.reset (m_opaque_sp->PeekAtNextEvent ());
-        return event.IsValid();
-    }
-    event.reset (NULL);
-    return false;
-}
+SBListener::SBListener(const char *name)
+    : m_opaque_sp(Listener::MakeListener(name)), m_unused_ptr(nullptr) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-bool
-SBListener::PeekAtNextEventForBroadcaster (const SBBroadcaster &broadcaster, SBEvent &event)
-{
-    if (m_opaque_sp && broadcaster.IsValid())
-    {
-        event.reset (m_opaque_sp->PeekAtNextEventForBroadcaster (broadcaster.get()));
-        return event.IsValid();
-    }
-    event.reset (NULL);
-    return false;
+  if (log)
+    log->Printf("SBListener::SBListener (name=\"%s\") => SBListener(%p)", name,
+                static_cast<void *>(m_opaque_sp.get()));
 }
 
-bool
-SBListener::PeekAtNextEventForBroadcasterWithType (const SBBroadcaster &broadcaster, uint32_t event_type_mask,
-                                                   SBEvent &event)
-{
-    if (m_opaque_sp && broadcaster.IsValid())
-    {
-        event.reset(m_opaque_sp->PeekAtNextEventForBroadcasterWithType (broadcaster.get(), event_type_mask));
-        return event.IsValid();
-    }
-    event.reset (NULL);
-    return false;
-}
+SBListener::SBListener(const SBListener &rhs)
+    : m_opaque_sp(rhs.m_opaque_sp), m_unused_ptr(nullptr) {}
 
-bool
-SBListener::GetNextEvent (SBEvent &event)
-{
-    if (m_opaque_sp)
-    {
-        EventSP event_sp;
-        if (m_opaque_sp->GetNextEvent (event_sp))
-        {
-            event.reset (event_sp);
-            return true;
-        }
-    }
-    event.reset (NULL);
-    return false;
+const lldb::SBListener &SBListener::operator=(const lldb::SBListener &rhs) {
+  if (this != &rhs) {
+    m_opaque_sp = rhs.m_opaque_sp;
+    m_unused_ptr = nullptr;
+  }
+  return *this;
 }
 
-bool
-SBListener::GetNextEventForBroadcaster (const SBBroadcaster &broadcaster, SBEvent &event)
-{
-    if (m_opaque_sp && broadcaster.IsValid())
-    {
-        EventSP event_sp;
-        if (m_opaque_sp->GetNextEventForBroadcaster (broadcaster.get(), event_sp))
-        {
-            event.reset (event_sp);
-            return true;
-        }
-    }
-    event.reset (NULL);
-    return false;
-}
+SBListener::SBListener(const lldb::ListenerSP &listener_sp)
+    : m_opaque_sp(listener_sp), m_unused_ptr(nullptr) {}
 
-bool
-SBListener::GetNextEventForBroadcasterWithType
-(
-    const SBBroadcaster &broadcaster,
-    uint32_t event_type_mask,
-    SBEvent &event
-)
-{
-    if (m_opaque_sp && broadcaster.IsValid())
-    {
-        EventSP event_sp;
-        if (m_opaque_sp->GetNextEventForBroadcasterWithType (broadcaster.get(),
-                                                              event_type_mask,
-                                                              event_sp))
-        {
-            event.reset (event_sp);
-            return true;
-        }
-    }
-    event.reset (NULL);
-    return false;
-}
+SBListener::~SBListener() {}
 
-bool
-SBListener::HandleBroadcastEvent (const SBEvent &event)
-{
-    if (m_opaque_sp)
-        return m_opaque_sp->HandleBroadcastEvent (event.GetSP());
+bool SBListener::IsValid() const { return m_opaque_sp != nullptr; }
+
+void SBListener::AddEvent(const SBEvent &event) {
+  EventSP &event_sp = event.GetSP();
+  if (event_sp)
+    m_opaque_sp->AddEvent(event_sp);
+}
+
+void SBListener::Clear() {
+  if (m_opaque_sp)
+    m_opaque_sp->Clear();
+}
+
+uint32_t SBListener::StartListeningForEventClass(SBDebugger &debugger,
+                                                 const char *broadcaster_class,
+                                                 uint32_t event_mask) {
+  if (m_opaque_sp) {
+    Debugger *lldb_debugger = debugger.get();
+    if (!lldb_debugger)
+      return 0;
+    BroadcastEventSpec event_spec(ConstString(broadcaster_class), event_mask);
+    return m_opaque_sp->StartListeningForEventSpec(
+        lldb_debugger->GetBroadcasterManager(), event_spec);
+  } else
+    return 0;
+}
+
+bool SBListener::StopListeningForEventClass(SBDebugger &debugger,
+                                            const char *broadcaster_class,
+                                            uint32_t event_mask) {
+  if (m_opaque_sp) {
+    Debugger *lldb_debugger = debugger.get();
+    if (!lldb_debugger)
+      return false;
+    BroadcastEventSpec event_spec(ConstString(broadcaster_class), event_mask);
+    return m_opaque_sp->StopListeningForEventSpec(
+        lldb_debugger->GetBroadcasterManager(), event_spec);
+  } else
     return false;
 }
 
-Listener *
-SBListener::operator->() const
-{
-    return m_opaque_sp.get();
-}
-
-Listener *
-SBListener::get() const
-{
-    return m_opaque_sp.get();
-}
-
-void
-SBListener::reset(ListenerSP listener_sp)
-{
-    m_opaque_sp = listener_sp;
-    m_unused_ptr = nullptr;
+uint32_t SBListener::StartListeningForEvents(const SBBroadcaster &broadcaster,
+                                             uint32_t event_mask) {
+  uint32_t acquired_event_mask = 0;
+  if (m_opaque_sp && broadcaster.IsValid()) {
+    acquired_event_mask =
+        m_opaque_sp->StartListeningForEvents(broadcaster.get(), event_mask);
+  }
+
+  Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API);
+  if (log) {
+    StreamString sstr_requested;
+    StreamString sstr_acquired;
+
+    Broadcaster *lldb_broadcaster = broadcaster.get();
+    if (lldb_broadcaster) {
+      const bool got_requested_names =
+          lldb_broadcaster->GetEventNames(sstr_requested, event_mask, false);
+      const bool got_acquired_names = lldb_broadcaster->GetEventNames(
+          sstr_acquired, acquired_event_mask, false);
+      log->Printf("SBListener(%p)::StartListeneingForEvents "
+                  "(SBBroadcaster(%p): %s, event_mask=0x%8.8x%s%s%s) => "
+                  "0x%8.8x%s%s%s",
+                  static_cast<void *>(m_opaque_sp.get()),
+                  static_cast<void *>(lldb_broadcaster),
+                  lldb_broadcaster->GetBroadcasterName().GetCString(),
+                  event_mask, got_requested_names ? " (" : "",
+                  sstr_requested.GetData(), got_requested_names ? ")" : "",
+                  acquired_event_mask, got_acquired_names ? " (" : "",
+                  sstr_acquired.GetData(), got_acquired_names ? ")" : "");
+    } else {
+      log->Printf("SBListener(%p)::StartListeneingForEvents "
+                  "(SBBroadcaster(%p), event_mask=0x%8.8x) => 0x%8.8x",
+                  static_cast<void *>(m_opaque_sp.get()),
+                  static_cast<void *>(lldb_broadcaster), event_mask,
+                  acquired_event_mask);
+    }
+  }
+
+  return acquired_event_mask;
+}
+
+bool SBListener::StopListeningForEvents(const SBBroadcaster &broadcaster,
+                                        uint32_t event_mask) {
+  if (m_opaque_sp && broadcaster.IsValid()) {
+    return m_opaque_sp->StopListeningForEvents(broadcaster.get(), event_mask);
+  }
+  return false;
+}
+
+bool SBListener::WaitForEvent(uint32_t timeout_secs, SBEvent &event) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+  if (log) {
+    if (timeout_secs == UINT32_MAX) {
+      log->Printf("SBListener(%p)::WaitForEvent (timeout_secs=INFINITE, "
+                  "SBEvent(%p))...",
+                  static_cast<void *>(m_opaque_sp.get()),
+                  static_cast<void *>(event.get()));
+    } else {
+      log->Printf(
+          "SBListener(%p)::WaitForEvent (timeout_secs=%d, SBEvent(%p))...",
+          static_cast<void *>(m_opaque_sp.get()), timeout_secs,
+          static_cast<void *>(event.get()));
+    }
+  }
+  bool success = false;
+
+  if (m_opaque_sp) {
+    std::chrono::microseconds timeout = std::chrono::microseconds(0);
+    if (timeout_secs != UINT32_MAX) {
+      assert(timeout_secs != 0); // Take this out after all calls with timeout
+                                 // set to zero have been removed....
+      timeout = std::chrono::seconds(timeout_secs);
+    }
+    EventSP event_sp;
+    if (m_opaque_sp->WaitForEvent(timeout, event_sp)) {
+      event.reset(event_sp);
+      success = true;
+    }
+  }
+
+  if (log) {
+    if (timeout_secs == UINT32_MAX) {
+      log->Printf("SBListener(%p)::WaitForEvent (timeout_secs=INFINITE, "
+                  "SBEvent(%p)) => %i",
+                  static_cast<void *>(m_opaque_sp.get()),
+                  static_cast<void *>(event.get()), success);
+    } else {
+      log->Printf(
+          "SBListener(%p)::WaitForEvent (timeout_secs=%d, SBEvent(%p)) => %i",
+          static_cast<void *>(m_opaque_sp.get()), timeout_secs,
+          static_cast<void *>(event.get()), success);
+    }
+  }
+  if (!success)
+    event.reset(NULL);
+  return success;
+}
+
+bool SBListener::WaitForEventForBroadcaster(uint32_t num_seconds,
+                                            const SBBroadcaster &broadcaster,
+                                            SBEvent &event) {
+  if (m_opaque_sp && broadcaster.IsValid()) {
+    std::chrono::microseconds timeout = std::chrono::microseconds(0);
+    if (num_seconds != UINT32_MAX)
+      timeout = std::chrono::seconds(num_seconds);
+    EventSP event_sp;
+    if (m_opaque_sp->WaitForEventForBroadcaster(timeout, broadcaster.get(),
+                                                event_sp)) {
+      event.reset(event_sp);
+      return true;
+    }
+  }
+  event.reset(NULL);
+  return false;
+}
+
+bool SBListener::WaitForEventForBroadcasterWithType(
+    uint32_t num_seconds, const SBBroadcaster &broadcaster,
+    uint32_t event_type_mask, SBEvent &event) {
+  if (m_opaque_sp && broadcaster.IsValid()) {
+    std::chrono::microseconds timeout = std::chrono::microseconds(0);
+    if (num_seconds != UINT32_MAX)
+      timeout = std::chrono::seconds(num_seconds);
+    EventSP event_sp;
+    if (m_opaque_sp->WaitForEventForBroadcasterWithType(
+            timeout, broadcaster.get(), event_type_mask, event_sp)) {
+      event.reset(event_sp);
+      return true;
+    }
+  }
+  event.reset(NULL);
+  return false;
+}
+
+bool SBListener::PeekAtNextEvent(SBEvent &event) {
+  if (m_opaque_sp) {
+    event.reset(m_opaque_sp->PeekAtNextEvent());
+    return event.IsValid();
+  }
+  event.reset(NULL);
+  return false;
+}
+
+bool SBListener::PeekAtNextEventForBroadcaster(const SBBroadcaster &broadcaster,
+                                               SBEvent &event) {
+  if (m_opaque_sp && broadcaster.IsValid()) {
+    event.reset(m_opaque_sp->PeekAtNextEventForBroadcaster(broadcaster.get()));
+    return event.IsValid();
+  }
+  event.reset(NULL);
+  return false;
+}
+
+bool SBListener::PeekAtNextEventForBroadcasterWithType(
+    const SBBroadcaster &broadcaster, uint32_t event_type_mask,
+    SBEvent &event) {
+  if (m_opaque_sp && broadcaster.IsValid()) {
+    event.reset(m_opaque_sp->PeekAtNextEventForBroadcasterWithType(
+        broadcaster.get(), event_type_mask));
+    return event.IsValid();
+  }
+  event.reset(NULL);
+  return false;
+}
+
+bool SBListener::GetNextEvent(SBEvent &event) {
+  if (m_opaque_sp) {
+    EventSP event_sp;
+    if (m_opaque_sp->GetNextEvent(event_sp)) {
+      event.reset(event_sp);
+      return true;
+    }
+  }
+  event.reset(NULL);
+  return false;
+}
+
+bool SBListener::GetNextEventForBroadcaster(const SBBroadcaster &broadcaster,
+                                            SBEvent &event) {
+  if (m_opaque_sp && broadcaster.IsValid()) {
+    EventSP event_sp;
+    if (m_opaque_sp->GetNextEventForBroadcaster(broadcaster.get(), event_sp)) {
+      event.reset(event_sp);
+      return true;
+    }
+  }
+  event.reset(NULL);
+  return false;
+}
+
+bool SBListener::GetNextEventForBroadcasterWithType(
+    const SBBroadcaster &broadcaster, uint32_t event_type_mask,
+    SBEvent &event) {
+  if (m_opaque_sp && broadcaster.IsValid()) {
+    EventSP event_sp;
+    if (m_opaque_sp->GetNextEventForBroadcasterWithType(
+            broadcaster.get(), event_type_mask, event_sp)) {
+      event.reset(event_sp);
+      return true;
+    }
+  }
+  event.reset(NULL);
+  return false;
+}
+
+bool SBListener::HandleBroadcastEvent(const SBEvent &event) {
+  if (m_opaque_sp)
+    return m_opaque_sp->HandleBroadcastEvent(event.GetSP());
+  return false;
+}
+
+Listener *SBListener::operator->() const { return m_opaque_sp.get(); }
+
+Listener *SBListener::get() const { return m_opaque_sp.get(); }
+
+void SBListener::reset(ListenerSP listener_sp) {
+  m_opaque_sp = listener_sp;
+  m_unused_ptr = nullptr;
 }
-
-

Modified: lldb/trunk/source/API/SBMemoryRegionInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBMemoryRegionInfo.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBMemoryRegionInfo.cpp (original)
+++ lldb/trunk/source/API/SBMemoryRegionInfo.cpp Tue Sep  6 15:57:50 2016
@@ -7,9 +7,9 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/API/SBMemoryRegionInfo.h"
 #include "lldb/API/SBDefines.h"
 #include "lldb/API/SBError.h"
-#include "lldb/API/SBMemoryRegionInfo.h"
 #include "lldb/API/SBStream.h"
 #include "lldb/Core/StreamString.h"
 #include "lldb/Target/MemoryRegionInfo.h"
@@ -17,115 +17,82 @@
 using namespace lldb;
 using namespace lldb_private;
 
+SBMemoryRegionInfo::SBMemoryRegionInfo()
+    : m_opaque_ap(new MemoryRegionInfo()) {}
 
-SBMemoryRegionInfo::SBMemoryRegionInfo () :
-    m_opaque_ap (new MemoryRegionInfo())
-{
+SBMemoryRegionInfo::SBMemoryRegionInfo(const MemoryRegionInfo *lldb_object_ptr)
+    : m_opaque_ap(new MemoryRegionInfo()) {
+  if (lldb_object_ptr)
+    ref() = *lldb_object_ptr;
 }
 
-SBMemoryRegionInfo::SBMemoryRegionInfo (const MemoryRegionInfo *lldb_object_ptr) :
-    m_opaque_ap (new MemoryRegionInfo())
-{
-    if (lldb_object_ptr)
-        ref() = *lldb_object_ptr;
+SBMemoryRegionInfo::SBMemoryRegionInfo(const SBMemoryRegionInfo &rhs)
+    : m_opaque_ap(new MemoryRegionInfo()) {
+  ref() = rhs.ref();
 }
 
-SBMemoryRegionInfo::SBMemoryRegionInfo(const SBMemoryRegionInfo &rhs) :
-    m_opaque_ap (new MemoryRegionInfo())
-{
+const SBMemoryRegionInfo &SBMemoryRegionInfo::
+operator=(const SBMemoryRegionInfo &rhs) {
+  if (this != &rhs) {
     ref() = rhs.ref();
+  }
+  return *this;
 }
 
-const SBMemoryRegionInfo &
-SBMemoryRegionInfo::operator = (const SBMemoryRegionInfo &rhs)
-{
-    if (this != &rhs)
-    {
-        ref() = rhs.ref();
-    }
-    return *this;
-}
-
-SBMemoryRegionInfo::~SBMemoryRegionInfo ()
-{
-}
+SBMemoryRegionInfo::~SBMemoryRegionInfo() {}
 
-void
-SBMemoryRegionInfo::Clear()
-{
-    m_opaque_ap->Clear();
-}
+void SBMemoryRegionInfo::Clear() { m_opaque_ap->Clear(); }
 
-bool
-SBMemoryRegionInfo::operator == (const SBMemoryRegionInfo &rhs) const
-{
-    return ref() == rhs.ref();
+bool SBMemoryRegionInfo::operator==(const SBMemoryRegionInfo &rhs) const {
+  return ref() == rhs.ref();
 }
 
-bool
-SBMemoryRegionInfo::operator != (const SBMemoryRegionInfo &rhs) const
-{
-    return ref() != rhs.ref();
+bool SBMemoryRegionInfo::operator!=(const SBMemoryRegionInfo &rhs) const {
+  return ref() != rhs.ref();
 }
 
-MemoryRegionInfo &
-SBMemoryRegionInfo::ref()
-{
-    return *m_opaque_ap;
-}
+MemoryRegionInfo &SBMemoryRegionInfo::ref() { return *m_opaque_ap; }
 
-const MemoryRegionInfo &
-SBMemoryRegionInfo::ref() const
-{
-    return *m_opaque_ap;
-}
+const MemoryRegionInfo &SBMemoryRegionInfo::ref() const { return *m_opaque_ap; }
 
-lldb::addr_t
-SBMemoryRegionInfo::GetRegionBase () {
-    return m_opaque_ap->GetRange().GetRangeBase();
+lldb::addr_t SBMemoryRegionInfo::GetRegionBase() {
+  return m_opaque_ap->GetRange().GetRangeBase();
 }
 
-lldb::addr_t
-SBMemoryRegionInfo::GetRegionEnd () {
-    return m_opaque_ap->GetRange().GetRangeEnd();
+lldb::addr_t SBMemoryRegionInfo::GetRegionEnd() {
+  return m_opaque_ap->GetRange().GetRangeEnd();
 }
 
-bool
-SBMemoryRegionInfo::IsReadable () {
-    return m_opaque_ap->GetReadable() == MemoryRegionInfo::eYes;
+bool SBMemoryRegionInfo::IsReadable() {
+  return m_opaque_ap->GetReadable() == MemoryRegionInfo::eYes;
 }
 
-bool
-SBMemoryRegionInfo::IsWritable () {
-    return m_opaque_ap->GetWritable() == MemoryRegionInfo::eYes;
+bool SBMemoryRegionInfo::IsWritable() {
+  return m_opaque_ap->GetWritable() == MemoryRegionInfo::eYes;
 }
 
-bool
-SBMemoryRegionInfo::IsExecutable () {
-    return m_opaque_ap->GetExecutable() == MemoryRegionInfo::eYes;
+bool SBMemoryRegionInfo::IsExecutable() {
+  return m_opaque_ap->GetExecutable() == MemoryRegionInfo::eYes;
 }
 
-bool
-SBMemoryRegionInfo::IsMapped () {
-    return m_opaque_ap->GetMapped() == MemoryRegionInfo::eYes;
+bool SBMemoryRegionInfo::IsMapped() {
+  return m_opaque_ap->GetMapped() == MemoryRegionInfo::eYes;
 }
 
-const char *
-SBMemoryRegionInfo::GetName () {
-    return m_opaque_ap->GetName().AsCString();
+const char *SBMemoryRegionInfo::GetName() {
+  return m_opaque_ap->GetName().AsCString();
 }
 
-bool
-SBMemoryRegionInfo::GetDescription (SBStream &description)
-{
-    Stream &strm = description.ref();
-    const addr_t load_addr = m_opaque_ap->GetRange().base;
+bool SBMemoryRegionInfo::GetDescription(SBStream &description) {
+  Stream &strm = description.ref();
+  const addr_t load_addr = m_opaque_ap->GetRange().base;
 
-    strm.Printf ("[0x%16.16" PRIx64 "-0x%16.16" PRIx64 " ", load_addr, load_addr + m_opaque_ap->GetRange().size);
-    strm.Printf (m_opaque_ap->GetReadable() ? "R" : "-");
-    strm.Printf (m_opaque_ap->GetWritable() ? "W" : "-");
-    strm.Printf (m_opaque_ap->GetExecutable() ? "X" : "-");
-    strm.Printf ("]");
+  strm.Printf("[0x%16.16" PRIx64 "-0x%16.16" PRIx64 " ", load_addr,
+              load_addr + m_opaque_ap->GetRange().size);
+  strm.Printf(m_opaque_ap->GetReadable() ? "R" : "-");
+  strm.Printf(m_opaque_ap->GetWritable() ? "W" : "-");
+  strm.Printf(m_opaque_ap->GetExecutable() ? "X" : "-");
+  strm.Printf("]");
 
-    return true;
+  return true;
 }

Modified: lldb/trunk/source/API/SBMemoryRegionInfoList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBMemoryRegionInfoList.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBMemoryRegionInfoList.cpp (original)
+++ lldb/trunk/source/API/SBMemoryRegionInfoList.cpp Tue Sep  6 15:57:50 2016
@@ -18,145 +18,100 @@
 using namespace lldb;
 using namespace lldb_private;
 
-class MemoryRegionInfoListImpl
-{
+class MemoryRegionInfoListImpl {
 public:
-    MemoryRegionInfoListImpl () :
-    m_regions()
-    {
-    }
-
-    MemoryRegionInfoListImpl (const MemoryRegionInfoListImpl& rhs) :
-    m_regions(rhs.m_regions)
-    {
-    }
-
-    MemoryRegionInfoListImpl&
-    operator = (const MemoryRegionInfoListImpl& rhs)
-    {
-        if (this == &rhs)
-            return *this;
-        m_regions = rhs.m_regions;
-        return *this;
-    }
-
-    uint32_t
-    GetSize ()
-    {
-        return m_regions.size();
-    }
-
-    void
-    Append (const lldb::SBMemoryRegionInfo& sb_region)
-    {
-        m_regions.push_back(sb_region);
-    }
-
-    void
-    Append (const MemoryRegionInfoListImpl& list)
-    {
-        for (auto val : list.m_regions)
-            Append (val);
-    }
-
-    void
-    Clear ()
-    {
-        m_regions.clear();
-    }
-
-    bool
-    GetMemoryRegionInfoAtIndex (uint32_t index, SBMemoryRegionInfo &region_info)
-    {
-        if (index >= GetSize())
-            return false;
-        region_info = m_regions[index];
-        return true;
-    }
+  MemoryRegionInfoListImpl() : m_regions() {}
+
+  MemoryRegionInfoListImpl(const MemoryRegionInfoListImpl &rhs)
+      : m_regions(rhs.m_regions) {}
+
+  MemoryRegionInfoListImpl &operator=(const MemoryRegionInfoListImpl &rhs) {
+    if (this == &rhs)
+      return *this;
+    m_regions = rhs.m_regions;
+    return *this;
+  }
+
+  uint32_t GetSize() { return m_regions.size(); }
+
+  void Append(const lldb::SBMemoryRegionInfo &sb_region) {
+    m_regions.push_back(sb_region);
+  }
+
+  void Append(const MemoryRegionInfoListImpl &list) {
+    for (auto val : list.m_regions)
+      Append(val);
+  }
+
+  void Clear() { m_regions.clear(); }
+
+  bool GetMemoryRegionInfoAtIndex(uint32_t index,
+                                  SBMemoryRegionInfo &region_info) {
+    if (index >= GetSize())
+      return false;
+    region_info = m_regions[index];
+    return true;
+  }
 
 private:
-    std::vector<lldb::SBMemoryRegionInfo> m_regions;
+  std::vector<lldb::SBMemoryRegionInfo> m_regions;
 };
 
-SBMemoryRegionInfoList::SBMemoryRegionInfoList () :
-    m_opaque_ap (new MemoryRegionInfoListImpl())
-{
-}
+SBMemoryRegionInfoList::SBMemoryRegionInfoList()
+    : m_opaque_ap(new MemoryRegionInfoListImpl()) {}
 
-SBMemoryRegionInfoList::SBMemoryRegionInfoList (const SBMemoryRegionInfoList& rhs) :
-    m_opaque_ap (new MemoryRegionInfoListImpl(*rhs.m_opaque_ap))
-{
-}
+SBMemoryRegionInfoList::SBMemoryRegionInfoList(
+    const SBMemoryRegionInfoList &rhs)
+    : m_opaque_ap(new MemoryRegionInfoListImpl(*rhs.m_opaque_ap)) {}
 
-SBMemoryRegionInfoList::~SBMemoryRegionInfoList ()
-{
-}
+SBMemoryRegionInfoList::~SBMemoryRegionInfoList() {}
 
-const SBMemoryRegionInfoList &
-SBMemoryRegionInfoList::operator = (const SBMemoryRegionInfoList &rhs)
-{
-    if (this != &rhs)
-    {
-        *m_opaque_ap = *rhs.m_opaque_ap;
-    }
-    return *this;
+const SBMemoryRegionInfoList &SBMemoryRegionInfoList::
+operator=(const SBMemoryRegionInfoList &rhs) {
+  if (this != &rhs) {
+    *m_opaque_ap = *rhs.m_opaque_ap;
+  }
+  return *this;
 }
 
-uint32_t
-SBMemoryRegionInfoList::GetSize() const
-{
-    return m_opaque_ap->GetSize();
+uint32_t SBMemoryRegionInfoList::GetSize() const {
+  return m_opaque_ap->GetSize();
 }
 
+bool SBMemoryRegionInfoList::GetMemoryRegionAtIndex(
+    uint32_t idx, SBMemoryRegionInfo &region_info) {
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-bool
-SBMemoryRegionInfoList::GetMemoryRegionAtIndex (uint32_t idx, SBMemoryRegionInfo &region_info)
-{
-    Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    bool result = m_opaque_ap->GetMemoryRegionInfoAtIndex(idx, region_info);
+  bool result = m_opaque_ap->GetMemoryRegionInfoAtIndex(idx, region_info);
 
-    if (log)
-    {
-        SBStream sstr;
-        region_info.GetDescription (sstr);
-        log->Printf ("SBMemoryRegionInfoList::GetMemoryRegionAtIndex (this.ap=%p, idx=%d) => SBMemoryRegionInfo (this.ap=%p, '%s')",
-                     static_cast<void*>(m_opaque_ap.get()), idx,
-                     static_cast<void*>(region_info.m_opaque_ap.get()), sstr.GetData());
-    }
+  if (log) {
+    SBStream sstr;
+    region_info.GetDescription(sstr);
+    log->Printf("SBMemoryRegionInfoList::GetMemoryRegionAtIndex (this.ap=%p, "
+                "idx=%d) => SBMemoryRegionInfo (this.ap=%p, '%s')",
+                static_cast<void *>(m_opaque_ap.get()), idx,
+                static_cast<void *>(region_info.m_opaque_ap.get()),
+                sstr.GetData());
+  }
 
-    return result;
+  return result;
 }
 
-void
-SBMemoryRegionInfoList::Clear()
-{
+void SBMemoryRegionInfoList::Clear() { m_opaque_ap->Clear(); }
 
-    m_opaque_ap->Clear();
+void SBMemoryRegionInfoList::Append(SBMemoryRegionInfo &sb_region) {
+  m_opaque_ap->Append(sb_region);
 }
 
-void
-SBMemoryRegionInfoList::Append(SBMemoryRegionInfo &sb_region)
-{
-    m_opaque_ap->Append(sb_region);
+void SBMemoryRegionInfoList::Append(SBMemoryRegionInfoList &sb_region_list) {
+  m_opaque_ap->Append(*sb_region_list);
 }
 
-void
-SBMemoryRegionInfoList::Append(SBMemoryRegionInfoList &sb_region_list)
-{
-    m_opaque_ap->Append(*sb_region_list);
+const MemoryRegionInfoListImpl *SBMemoryRegionInfoList::operator->() const {
+  return m_opaque_ap.get();
 }
 
-const MemoryRegionInfoListImpl *
-SBMemoryRegionInfoList::operator->() const
-{
-    return m_opaque_ap.get();
+const MemoryRegionInfoListImpl &SBMemoryRegionInfoList::operator*() const {
+  assert(m_opaque_ap.get());
+  return *m_opaque_ap.get();
 }
-
-const MemoryRegionInfoListImpl&
-SBMemoryRegionInfoList::operator*() const
-{
-    assert (m_opaque_ap.get());
-    return *m_opaque_ap.get();
-}
-

Modified: lldb/trunk/source/API/SBModule.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBModule.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBModule.cpp (original)
+++ lldb/trunk/source/API/SBModule.cpp Tue Sep  6 15:57:50 2016
@@ -14,8 +14,8 @@
 #include "lldb/API/SBProcess.h"
 #include "lldb/API/SBStream.h"
 #include "lldb/API/SBSymbolContextList.h"
-#include "lldb/Core/Module.h"
 #include "lldb/Core/Log.h"
+#include "lldb/Core/Module.h"
 #include "lldb/Core/Section.h"
 #include "lldb/Core/StreamString.h"
 #include "lldb/Core/ValueObjectList.h"
@@ -31,699 +31,537 @@
 using namespace lldb;
 using namespace lldb_private;
 
+SBModule::SBModule() : m_opaque_sp() {}
 
-SBModule::SBModule () :
-    m_opaque_sp ()
-{
-}
-
-SBModule::SBModule (const lldb::ModuleSP& module_sp) :
-    m_opaque_sp (module_sp)
-{
-}
-
-SBModule::SBModule(const SBModuleSpec &module_spec) :
-    m_opaque_sp ()
-{
-    ModuleSP module_sp;
-    Error error = ModuleList::GetSharedModule (*module_spec.m_opaque_ap,
-                                               module_sp,
-                                               NULL,
-                                               NULL,
-                                               NULL);
-    if (module_sp)
-        SetSP(module_sp);
-}
-
-SBModule::SBModule(const SBModule &rhs) :
-    m_opaque_sp (rhs.m_opaque_sp)
-{
-}
-
-SBModule::SBModule (lldb::SBProcess &process, lldb::addr_t header_addr) :
-    m_opaque_sp ()
-{
-    ProcessSP process_sp (process.GetSP());
-    if (process_sp)
-    {
-        m_opaque_sp = process_sp->ReadModuleFromMemory (FileSpec(), header_addr);
-        if (m_opaque_sp)
-        {
-            Target &target = process_sp->GetTarget();
-            bool changed = false;
-            m_opaque_sp->SetLoadAddress(target, 0, true, changed);
-            target.GetImages().Append(m_opaque_sp);
-        }
-    }
-}
+SBModule::SBModule(const lldb::ModuleSP &module_sp) : m_opaque_sp(module_sp) {}
 
-const SBModule &
-SBModule::operator = (const SBModule &rhs)
-{
-    if (this != &rhs)
-        m_opaque_sp = rhs.m_opaque_sp;
-    return *this;
+SBModule::SBModule(const SBModuleSpec &module_spec) : m_opaque_sp() {
+  ModuleSP module_sp;
+  Error error = ModuleList::GetSharedModule(*module_spec.m_opaque_ap, module_sp,
+                                            NULL, NULL, NULL);
+  if (module_sp)
+    SetSP(module_sp);
 }
 
-SBModule::~SBModule ()
-{
-}
+SBModule::SBModule(const SBModule &rhs) : m_opaque_sp(rhs.m_opaque_sp) {}
 
-bool
-SBModule::IsValid () const
-{
-    return m_opaque_sp.get() != NULL;
+SBModule::SBModule(lldb::SBProcess &process, lldb::addr_t header_addr)
+    : m_opaque_sp() {
+  ProcessSP process_sp(process.GetSP());
+  if (process_sp) {
+    m_opaque_sp = process_sp->ReadModuleFromMemory(FileSpec(), header_addr);
+    if (m_opaque_sp) {
+      Target &target = process_sp->GetTarget();
+      bool changed = false;
+      m_opaque_sp->SetLoadAddress(target, 0, true, changed);
+      target.GetImages().Append(m_opaque_sp);
+    }
+  }
 }
 
-void
-SBModule::Clear()
-{
-    m_opaque_sp.reset();
+const SBModule &SBModule::operator=(const SBModule &rhs) {
+  if (this != &rhs)
+    m_opaque_sp = rhs.m_opaque_sp;
+  return *this;
 }
 
-SBFileSpec
-SBModule::GetFileSpec () const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+SBModule::~SBModule() {}
 
-    SBFileSpec file_spec;
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-        file_spec.SetFileSpec(module_sp->GetFileSpec());
+bool SBModule::IsValid() const { return m_opaque_sp.get() != NULL; }
 
-    if (log)
-        log->Printf ("SBModule(%p)::GetFileSpec () => SBFileSpec(%p)",
-                     static_cast<void*>(module_sp.get()),
-                     static_cast<const void*>(file_spec.get()));
-
-    return file_spec;
-}
-
-lldb::SBFileSpec
-SBModule::GetPlatformFileSpec () const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    SBFileSpec file_spec;
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-        file_spec.SetFileSpec(module_sp->GetPlatformFileSpec());
-
-    if (log)
-        log->Printf ("SBModule(%p)::GetPlatformFileSpec () => SBFileSpec(%p)",
-                     static_cast<void*>(module_sp.get()),
-                     static_cast<const void*>(file_spec.get()));
-
-    return file_spec;
-}
-
-bool
-SBModule::SetPlatformFileSpec (const lldb::SBFileSpec &platform_file)
-{
-    bool result = false;
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-    {
-        module_sp->SetPlatformFileSpec(*platform_file);
-        result = true;
-    }
-
-    if (log)
-        log->Printf ("SBModule(%p)::SetPlatformFileSpec (SBFileSpec(%p (%s)) => %i",
-                     static_cast<void*>(module_sp.get()),
-                     static_cast<const void*>(platform_file.get()),
-                     platform_file->GetPath().c_str(), result);
-    return result;
-}
-
-lldb::SBFileSpec
-SBModule::GetRemoteInstallFileSpec ()
-{
-    SBFileSpec sb_file_spec;
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-        sb_file_spec.SetFileSpec (module_sp->GetRemoteInstallFileSpec());
-    return sb_file_spec;
-}
-
-bool
-SBModule::SetRemoteInstallFileSpec (lldb::SBFileSpec &file)
-{
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-    {
-        module_sp->SetRemoteInstallFileSpec(file.ref());
-        return true;
-    }
-    return false;
-}
+void SBModule::Clear() { m_opaque_sp.reset(); }
 
+SBFileSpec SBModule::GetFileSpec() const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-const uint8_t *
-SBModule::GetUUIDBytes () const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+  SBFileSpec file_spec;
+  ModuleSP module_sp(GetSP());
+  if (module_sp)
+    file_spec.SetFileSpec(module_sp->GetFileSpec());
 
-    const uint8_t *uuid_bytes = NULL;
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-        uuid_bytes = (const uint8_t *)module_sp->GetUUID().GetBytes();
+  if (log)
+    log->Printf("SBModule(%p)::GetFileSpec () => SBFileSpec(%p)",
+                static_cast<void *>(module_sp.get()),
+                static_cast<const void *>(file_spec.get()));
 
-    if (log)
-    {
-        if (uuid_bytes)
-        {
-            StreamString s;
-            module_sp->GetUUID().Dump (&s);
-            log->Printf ("SBModule(%p)::GetUUIDBytes () => %s",
-                         static_cast<void*>(module_sp.get()), s.GetData());
-        }
-        else
-            log->Printf ("SBModule(%p)::GetUUIDBytes () => NULL",
-                         static_cast<void*>(module_sp.get()));
-    }
-    return uuid_bytes;
+  return file_spec;
 }
 
+lldb::SBFileSpec SBModule::GetPlatformFileSpec() const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-const char *
-SBModule::GetUUIDString () const
-{
-    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    const char *uuid_cstr = NULL;
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-    {
-        // We are going to return a "const char *" value through the public
-        // API, so we need to constify it so it gets added permanently the
-        // string pool and then we don't need to worry about the lifetime of the
-        // string as it will never go away once it has been put into the ConstString
-        // string pool
-        uuid_cstr = ConstString(module_sp->GetUUID().GetAsString()).GetCString();
-    }
-
-    if (uuid_cstr && uuid_cstr[0])
-    {
-        if (log)
-            log->Printf ("SBModule(%p)::GetUUIDString () => %s", static_cast<void*>(module_sp.get()), uuid_cstr);
-        return uuid_cstr;
-    }
-
-    if (log)
-        log->Printf ("SBModule(%p)::GetUUIDString () => NULL", static_cast<void*>(module_sp.get()));
-    return NULL;
-}
+  SBFileSpec file_spec;
+  ModuleSP module_sp(GetSP());
+  if (module_sp)
+    file_spec.SetFileSpec(module_sp->GetPlatformFileSpec());
 
+  if (log)
+    log->Printf("SBModule(%p)::GetPlatformFileSpec () => SBFileSpec(%p)",
+                static_cast<void *>(module_sp.get()),
+                static_cast<const void *>(file_spec.get()));
 
-bool
-SBModule::operator == (const SBModule &rhs) const
-{
-    if (m_opaque_sp)
-        return m_opaque_sp.get() == rhs.m_opaque_sp.get();
-    return false;
+  return file_spec;
 }
 
-bool
-SBModule::operator != (const SBModule &rhs) const
-{
-    if (m_opaque_sp)
-        return m_opaque_sp.get() != rhs.m_opaque_sp.get();
-    return false;
-}
+bool SBModule::SetPlatformFileSpec(const lldb::SBFileSpec &platform_file) {
+  bool result = false;
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-ModuleSP
-SBModule::GetSP () const
-{
-    return m_opaque_sp;
-}
+  ModuleSP module_sp(GetSP());
+  if (module_sp) {
+    module_sp->SetPlatformFileSpec(*platform_file);
+    result = true;
+  }
 
-void
-SBModule::SetSP (const ModuleSP &module_sp)
-{
-    m_opaque_sp = module_sp;
+  if (log)
+    log->Printf("SBModule(%p)::SetPlatformFileSpec (SBFileSpec(%p (%s)) => %i",
+                static_cast<void *>(module_sp.get()),
+                static_cast<const void *>(platform_file.get()),
+                platform_file->GetPath().c_str(), result);
+  return result;
 }
 
-SBAddress
-SBModule::ResolveFileAddress (lldb::addr_t vm_addr)
-{
-    lldb::SBAddress sb_addr;
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-    {
-        Address addr;
-        if (module_sp->ResolveFileAddress (vm_addr, addr))
-            sb_addr.ref() = addr;
-    }
-    return sb_addr;
+lldb::SBFileSpec SBModule::GetRemoteInstallFileSpec() {
+  SBFileSpec sb_file_spec;
+  ModuleSP module_sp(GetSP());
+  if (module_sp)
+    sb_file_spec.SetFileSpec(module_sp->GetRemoteInstallFileSpec());
+  return sb_file_spec;
 }
 
-SBSymbolContext
-SBModule::ResolveSymbolContextForAddress (const SBAddress& addr, uint32_t resolve_scope)
-{
-    SBSymbolContext sb_sc;
-    ModuleSP module_sp (GetSP ());
-    if (module_sp && addr.IsValid())
-        module_sp->ResolveSymbolContextForAddress (addr.ref(), resolve_scope, *sb_sc);
-    return sb_sc;
-}
-
-bool
-SBModule::GetDescription (SBStream &description)
-{
-    Stream &strm = description.ref();
-
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-    {
-        module_sp->GetDescription (&strm);
-    }
-    else
-        strm.PutCString ("No value");
-
+bool SBModule::SetRemoteInstallFileSpec(lldb::SBFileSpec &file) {
+  ModuleSP module_sp(GetSP());
+  if (module_sp) {
+    module_sp->SetRemoteInstallFileSpec(file.ref());
     return true;
+  }
+  return false;
 }
 
-uint32_t
-SBModule::GetNumCompileUnits()
-{
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-    {
-        return module_sp->GetNumCompileUnits ();
-    }
-    return 0;
-}
-
-SBCompileUnit
-SBModule::GetCompileUnitAtIndex (uint32_t index)
-{
-    SBCompileUnit sb_cu;
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-    {
-        CompUnitSP cu_sp = module_sp->GetCompileUnitAtIndex (index);
-        sb_cu.reset(cu_sp.get());
-    }
-    return sb_cu;
-}
+const uint8_t *SBModule::GetUUIDBytes() const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
-static Symtab *
-GetUnifiedSymbolTable (const lldb::ModuleSP& module_sp)
-{
-    if (module_sp)
-    {
-        SymbolVendor *symbols = module_sp->GetSymbolVendor();
-        if (symbols)
-            return symbols->GetSymtab();
-    }
-    return NULL;
-}
+  const uint8_t *uuid_bytes = NULL;
+  ModuleSP module_sp(GetSP());
+  if (module_sp)
+    uuid_bytes = (const uint8_t *)module_sp->GetUUID().GetBytes();
+
+  if (log) {
+    if (uuid_bytes) {
+      StreamString s;
+      module_sp->GetUUID().Dump(&s);
+      log->Printf("SBModule(%p)::GetUUIDBytes () => %s",
+                  static_cast<void *>(module_sp.get()), s.GetData());
+    } else
+      log->Printf("SBModule(%p)::GetUUIDBytes () => NULL",
+                  static_cast<void *>(module_sp.get()));
+  }
+  return uuid_bytes;
+}
+
+const char *SBModule::GetUUIDString() const {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+  const char *uuid_cstr = NULL;
+  ModuleSP module_sp(GetSP());
+  if (module_sp) {
+    // We are going to return a "const char *" value through the public
+    // API, so we need to constify it so it gets added permanently the
+    // string pool and then we don't need to worry about the lifetime of the
+    // string as it will never go away once it has been put into the ConstString
+    // string pool
+    uuid_cstr = ConstString(module_sp->GetUUID().GetAsString()).GetCString();
+  }
 
-size_t
-SBModule::GetNumSymbols ()
-{
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-    {
-        Symtab *symtab = GetUnifiedSymbolTable (module_sp);
-        if (symtab)
-            return symtab->GetNumSymbols();
-    }
-    return 0;
+  if (uuid_cstr && uuid_cstr[0]) {
+    if (log)
+      log->Printf("SBModule(%p)::GetUUIDString () => %s",
+                  static_cast<void *>(module_sp.get()), uuid_cstr);
+    return uuid_cstr;
+  }
+
+  if (log)
+    log->Printf("SBModule(%p)::GetUUIDString () => NULL",
+                static_cast<void *>(module_sp.get()));
+  return NULL;
+}
+
+bool SBModule::operator==(const SBModule &rhs) const {
+  if (m_opaque_sp)
+    return m_opaque_sp.get() == rhs.m_opaque_sp.get();
+  return false;
+}
+
+bool SBModule::operator!=(const SBModule &rhs) const {
+  if (m_opaque_sp)
+    return m_opaque_sp.get() != rhs.m_opaque_sp.get();
+  return false;
+}
+
+ModuleSP SBModule::GetSP() const { return m_opaque_sp; }
+
+void SBModule::SetSP(const ModuleSP &module_sp) { m_opaque_sp = module_sp; }
+
+SBAddress SBModule::ResolveFileAddress(lldb::addr_t vm_addr) {
+  lldb::SBAddress sb_addr;
+  ModuleSP module_sp(GetSP());
+  if (module_sp) {
+    Address addr;
+    if (module_sp->ResolveFileAddress(vm_addr, addr))
+      sb_addr.ref() = addr;
+  }
+  return sb_addr;
 }
 
-SBSymbol
-SBModule::GetSymbolAtIndex (size_t idx)
-{
-    SBSymbol sb_symbol;
-    ModuleSP module_sp (GetSP ());
-    Symtab *symtab = GetUnifiedSymbolTable (module_sp);
+SBSymbolContext
+SBModule::ResolveSymbolContextForAddress(const SBAddress &addr,
+                                         uint32_t resolve_scope) {
+  SBSymbolContext sb_sc;
+  ModuleSP module_sp(GetSP());
+  if (module_sp && addr.IsValid())
+    module_sp->ResolveSymbolContextForAddress(addr.ref(), resolve_scope,
+                                              *sb_sc);
+  return sb_sc;
+}
+
+bool SBModule::GetDescription(SBStream &description) {
+  Stream &strm = description.ref();
+
+  ModuleSP module_sp(GetSP());
+  if (module_sp) {
+    module_sp->GetDescription(&strm);
+  } else
+    strm.PutCString("No value");
+
+  return true;
+}
+
+uint32_t SBModule::GetNumCompileUnits() {
+  ModuleSP module_sp(GetSP());
+  if (module_sp) {
+    return module_sp->GetNumCompileUnits();
+  }
+  return 0;
+}
+
+SBCompileUnit SBModule::GetCompileUnitAtIndex(uint32_t index) {
+  SBCompileUnit sb_cu;
+  ModuleSP module_sp(GetSP());
+  if (module_sp) {
+    CompUnitSP cu_sp = module_sp->GetCompileUnitAtIndex(index);
+    sb_cu.reset(cu_sp.get());
+  }
+  return sb_cu;
+}
+
+static Symtab *GetUnifiedSymbolTable(const lldb::ModuleSP &module_sp) {
+  if (module_sp) {
+    SymbolVendor *symbols = module_sp->GetSymbolVendor();
+    if (symbols)
+      return symbols->GetSymtab();
+  }
+  return NULL;
+}
+
+size_t SBModule::GetNumSymbols() {
+  ModuleSP module_sp(GetSP());
+  if (module_sp) {
+    Symtab *symtab = GetUnifiedSymbolTable(module_sp);
     if (symtab)
-        sb_symbol.SetSymbol(symtab->SymbolAtIndex (idx));
-    return sb_symbol;
-}
-
-lldb::SBSymbol
-SBModule::FindSymbol (const char *name,
-                      lldb::SymbolType symbol_type)
-{
-    SBSymbol sb_symbol;
-    if (name && name[0])
-    {
-        ModuleSP module_sp (GetSP ());
-        Symtab *symtab = GetUnifiedSymbolTable (module_sp);
-        if (symtab)
-            sb_symbol.SetSymbol(symtab->FindFirstSymbolWithNameAndType(ConstString(name), symbol_type, Symtab::eDebugAny, Symtab::eVisibilityAny));
-    }
-    return sb_symbol;
-}
-
-
-lldb::SBSymbolContextList
-SBModule::FindSymbols (const char *name, lldb::SymbolType symbol_type)
-{
-    SBSymbolContextList sb_sc_list;
-    if (name && name[0])
-    {
-        ModuleSP module_sp (GetSP ());
-        Symtab *symtab = GetUnifiedSymbolTable (module_sp);
-        if (symtab)
-        {
-            std::vector<uint32_t> matching_symbol_indexes;
-            const size_t num_matches = symtab->FindAllSymbolsWithNameAndType(ConstString(name), symbol_type, matching_symbol_indexes);
-            if (num_matches)
-            {
-                SymbolContext sc;
-                sc.module_sp = module_sp;
-                SymbolContextList &sc_list = *sb_sc_list;
-                for (size_t i=0; i<num_matches; ++i)
-                {
-                    sc.symbol = symtab->SymbolAtIndex (matching_symbol_indexes[i]);
-                    if (sc.symbol)
-                        sc_list.Append(sc);
-                }
-            }
-        }
-    }
-    return sb_sc_list;
-    
-}
-
-
-
-size_t
-SBModule::GetNumSections ()
-{
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-    {
-        // Give the symbol vendor a chance to add to the unified section list.
-        module_sp->GetSymbolVendor();
-        SectionList *section_list = module_sp->GetSectionList();
-        if (section_list)
-            return section_list->GetSize();
-    }
-    return 0;
-}
-
-SBSection
-SBModule::GetSectionAtIndex (size_t idx)
-{
-    SBSection sb_section;
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-    {
-        // Give the symbol vendor a chance to add to the unified section list.
-        module_sp->GetSymbolVendor();
-        SectionList *section_list = module_sp->GetSectionList ();
-
-        if (section_list)
-            sb_section.SetSP(section_list->GetSectionAtIndex (idx));
-    }
-    return sb_section;
-}
-
-lldb::SBSymbolContextList
-SBModule::FindFunctions (const char *name, 
-                         uint32_t name_type_mask)
-{
-    lldb::SBSymbolContextList sb_sc_list;
-    ModuleSP module_sp (GetSP ());
-    if (name && module_sp)
-    {
-        const bool append = true;
-        const bool symbols_ok = true;
-        const bool inlines_ok = true;
-        module_sp->FindFunctions (ConstString(name),
-                                  NULL,
-                                  name_type_mask, 
-                                  symbols_ok,
-                                  inlines_ok,
-                                  append, 
-                                  *sb_sc_list);
-    }
-    return sb_sc_list;
-}
-
-
-SBValueList
-SBModule::FindGlobalVariables (SBTarget &target, const char *name, uint32_t max_matches)
-{
-    SBValueList sb_value_list;
-    ModuleSP module_sp (GetSP ());
-    if (name && module_sp)
-    {
-        VariableList variable_list;
-        const uint32_t match_count = module_sp->FindGlobalVariables (ConstString (name),
-                                                                     NULL,
-                                                                     false, 
-                                                                     max_matches,
-                                                                     variable_list);
-
-        if (match_count > 0)
-        {
-            for (uint32_t i=0; i<match_count; ++i)
-            {
-                lldb::ValueObjectSP valobj_sp;
-                TargetSP target_sp (target.GetSP());
-                valobj_sp = ValueObjectVariable::Create (target_sp.get(), variable_list.GetVariableAtIndex(i));
-                if (valobj_sp)
-                    sb_value_list.Append(SBValue(valobj_sp));
-            }
-        }
-    }
-    
-    return sb_value_list;
-}
-
-lldb::SBValue
-SBModule::FindFirstGlobalVariable (lldb::SBTarget &target, const char *name)
-{
-    SBValueList sb_value_list(FindGlobalVariables(target, name, 1));
-    if (sb_value_list.IsValid() && sb_value_list.GetSize() > 0)
-        return sb_value_list.GetValueAtIndex(0);
-    return SBValue();
-}
-
-lldb::SBType
-SBModule::FindFirstType (const char *name_cstr)
-{
-    SBType sb_type;
-    ModuleSP module_sp (GetSP ());
-    if (name_cstr && module_sp)
-    {
-        SymbolContext sc;
-        const bool exact_match = false;
-        ConstString name(name_cstr);
-
-        sb_type = SBType (module_sp->FindFirstType(sc, name, exact_match));
-        
-        if (!sb_type.IsValid())
-        {
-            TypeSystem *type_system = module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
-            if (type_system)
-                sb_type = SBType (type_system->GetBuiltinTypeByName(name));
-        }
-    }
-    return sb_type;
-}
-
-lldb::SBType
-SBModule::GetBasicType(lldb::BasicType type)
-{
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-    {
-        TypeSystem *type_system = module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
-        if (type_system)
-            return SBType (type_system->GetBasicTypeFromAST(type));
-    }
-    return SBType();
-}
-
-lldb::SBTypeList
-SBModule::FindTypes (const char *type)
-{
-    SBTypeList retval;
-    
-    ModuleSP module_sp (GetSP ());
-    if (type && module_sp)
-    {
-        SymbolContext sc;
-        TypeList type_list;
-        const bool exact_match = false;
-        ConstString name(type);
-        llvm::DenseSet<SymbolFile *> searched_symbol_files;
-        const uint32_t num_matches = module_sp->FindTypes (sc,
-                                                           name,
-                                                           exact_match,
-                                                           UINT32_MAX,
-                                                           searched_symbol_files,
-                                                           type_list);
-        
-        if (num_matches > 0)
-        {
-            for (size_t idx = 0; idx < num_matches; idx++)
-            {
-                TypeSP type_sp (type_list.GetTypeAtIndex(idx));
-                if (type_sp)
-                    retval.Append(SBType(type_sp));
-            }
-        }
-        else
-        {
-            TypeSystem *type_system = module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
-            if (type_system)
-            {
-                CompilerType compiler_type = type_system->GetBuiltinTypeByName(name);
-                if (compiler_type)
-                    retval.Append(SBType(compiler_type));
-            }
-        }
-    }
-
-    return retval;
-}
-
-lldb::SBType
-SBModule::GetTypeByID (lldb::user_id_t uid)
-{
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-    {
-        SymbolVendor* vendor = module_sp->GetSymbolVendor();
-        if (vendor)
-        {
-            Type *type_ptr = vendor->ResolveTypeUID(uid);
-            if (type_ptr)
-                return SBType(type_ptr->shared_from_this());
-        }
-    }
-    return SBType();
-}
-
-lldb::SBTypeList
-SBModule::GetTypes (uint32_t type_mask)
-{
-    SBTypeList sb_type_list;
-    
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-    {
-        SymbolVendor* vendor = module_sp->GetSymbolVendor();
-        if (vendor)
-        {
-            TypeList type_list;
-            vendor->GetTypes (NULL, type_mask, type_list);
-            sb_type_list.m_opaque_ap->Append(type_list);
-        }
-    }
-    return sb_type_list;
-}
-
-SBSection
-SBModule::FindSection (const char *sect_name)
-{
-    SBSection sb_section;
-    
-    ModuleSP module_sp (GetSP ());
-    if (sect_name && module_sp)
-    {
-        // Give the symbol vendor a chance to add to the unified section list.
-        module_sp->GetSymbolVendor();
-        SectionList *section_list = module_sp->GetSectionList();
-        if (section_list)
-        {
-            ConstString const_sect_name(sect_name);
-            SectionSP section_sp (section_list->FindSectionByName(const_sect_name));
-            if (section_sp)
-            {
-                sb_section.SetSP (section_sp);
-            }
-        }
-    }
-    return sb_section;
-}
-
-lldb::ByteOrder
-SBModule::GetByteOrder ()
-{
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-        return module_sp->GetArchitecture().GetByteOrder();
-    return eByteOrderInvalid;
-}
-
-const char *
-SBModule::GetTriple ()
-{
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-    {
-        std::string triple (module_sp->GetArchitecture().GetTriple().str());
-        // Unique the string so we don't run into ownership issues since
-        // the const strings put the string into the string pool once and
-        // the strings never comes out
-        ConstString const_triple (triple.c_str());
-        return const_triple.GetCString();
-    }
-    return NULL;
-}
-
-uint32_t
-SBModule::GetAddressByteSize()
-{
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-        return module_sp->GetArchitecture().GetAddressByteSize();
-    return sizeof(void*);
-}
-
-
-uint32_t
-SBModule::GetVersion (uint32_t *versions, uint32_t num_versions)
-{
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-        return module_sp->GetVersion(versions, num_versions);
-    else
-    {
-        if (versions && num_versions)
-        {
-            for (uint32_t i=0; i<num_versions; ++i)
-                versions[i] = UINT32_MAX;
-        }
-        return 0;
-    }
+      return symtab->GetNumSymbols();
+  }
+  return 0;
+}
+
+SBSymbol SBModule::GetSymbolAtIndex(size_t idx) {
+  SBSymbol sb_symbol;
+  ModuleSP module_sp(GetSP());
+  Symtab *symtab = GetUnifiedSymbolTable(module_sp);
+  if (symtab)
+    sb_symbol.SetSymbol(symtab->SymbolAtIndex(idx));
+  return sb_symbol;
+}
+
+lldb::SBSymbol SBModule::FindSymbol(const char *name,
+                                    lldb::SymbolType symbol_type) {
+  SBSymbol sb_symbol;
+  if (name && name[0]) {
+    ModuleSP module_sp(GetSP());
+    Symtab *symtab = GetUnifiedSymbolTable(module_sp);
+    if (symtab)
+      sb_symbol.SetSymbol(symtab->FindFirstSymbolWithNameAndType(
+          ConstString(name), symbol_type, Symtab::eDebugAny,
+          Symtab::eVisibilityAny));
+  }
+  return sb_symbol;
 }
 
-lldb::SBFileSpec
-SBModule::GetSymbolFileSpec() const
-{
-    lldb::SBFileSpec sb_file_spec;
+lldb::SBSymbolContextList SBModule::FindSymbols(const char *name,
+                                                lldb::SymbolType symbol_type) {
+  SBSymbolContextList sb_sc_list;
+  if (name && name[0]) {
     ModuleSP module_sp(GetSP());
-    if (module_sp)
-    {
-        SymbolVendor *symbol_vendor_ptr = module_sp->GetSymbolVendor();
-        if (symbol_vendor_ptr)
-            sb_file_spec.SetFileSpec(symbol_vendor_ptr->GetMainFileSpec());
+    Symtab *symtab = GetUnifiedSymbolTable(module_sp);
+    if (symtab) {
+      std::vector<uint32_t> matching_symbol_indexes;
+      const size_t num_matches = symtab->FindAllSymbolsWithNameAndType(
+          ConstString(name), symbol_type, matching_symbol_indexes);
+      if (num_matches) {
+        SymbolContext sc;
+        sc.module_sp = module_sp;
+        SymbolContextList &sc_list = *sb_sc_list;
+        for (size_t i = 0; i < num_matches; ++i) {
+          sc.symbol = symtab->SymbolAtIndex(matching_symbol_indexes[i]);
+          if (sc.symbol)
+            sc_list.Append(sc);
+        }
+      }
+    }
+  }
+  return sb_sc_list;
+}
+
+size_t SBModule::GetNumSections() {
+  ModuleSP module_sp(GetSP());
+  if (module_sp) {
+    // Give the symbol vendor a chance to add to the unified section list.
+    module_sp->GetSymbolVendor();
+    SectionList *section_list = module_sp->GetSectionList();
+    if (section_list)
+      return section_list->GetSize();
+  }
+  return 0;
+}
+
+SBSection SBModule::GetSectionAtIndex(size_t idx) {
+  SBSection sb_section;
+  ModuleSP module_sp(GetSP());
+  if (module_sp) {
+    // Give the symbol vendor a chance to add to the unified section list.
+    module_sp->GetSymbolVendor();
+    SectionList *section_list = module_sp->GetSectionList();
+
+    if (section_list)
+      sb_section.SetSP(section_list->GetSectionAtIndex(idx));
+  }
+  return sb_section;
+}
+
+lldb::SBSymbolContextList SBModule::FindFunctions(const char *name,
+                                                  uint32_t name_type_mask) {
+  lldb::SBSymbolContextList sb_sc_list;
+  ModuleSP module_sp(GetSP());
+  if (name && module_sp) {
+    const bool append = true;
+    const bool symbols_ok = true;
+    const bool inlines_ok = true;
+    module_sp->FindFunctions(ConstString(name), NULL, name_type_mask,
+                             symbols_ok, inlines_ok, append, *sb_sc_list);
+  }
+  return sb_sc_list;
+}
+
+SBValueList SBModule::FindGlobalVariables(SBTarget &target, const char *name,
+                                          uint32_t max_matches) {
+  SBValueList sb_value_list;
+  ModuleSP module_sp(GetSP());
+  if (name && module_sp) {
+    VariableList variable_list;
+    const uint32_t match_count = module_sp->FindGlobalVariables(
+        ConstString(name), NULL, false, max_matches, variable_list);
+
+    if (match_count > 0) {
+      for (uint32_t i = 0; i < match_count; ++i) {
+        lldb::ValueObjectSP valobj_sp;
+        TargetSP target_sp(target.GetSP());
+        valobj_sp = ValueObjectVariable::Create(
+            target_sp.get(), variable_list.GetVariableAtIndex(i));
+        if (valobj_sp)
+          sb_value_list.Append(SBValue(valobj_sp));
+      }
+    }
+  }
+
+  return sb_value_list;
+}
+
+lldb::SBValue SBModule::FindFirstGlobalVariable(lldb::SBTarget &target,
+                                                const char *name) {
+  SBValueList sb_value_list(FindGlobalVariables(target, name, 1));
+  if (sb_value_list.IsValid() && sb_value_list.GetSize() > 0)
+    return sb_value_list.GetValueAtIndex(0);
+  return SBValue();
+}
+
+lldb::SBType SBModule::FindFirstType(const char *name_cstr) {
+  SBType sb_type;
+  ModuleSP module_sp(GetSP());
+  if (name_cstr && module_sp) {
+    SymbolContext sc;
+    const bool exact_match = false;
+    ConstString name(name_cstr);
+
+    sb_type = SBType(module_sp->FindFirstType(sc, name, exact_match));
+
+    if (!sb_type.IsValid()) {
+      TypeSystem *type_system =
+          module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
+      if (type_system)
+        sb_type = SBType(type_system->GetBuiltinTypeByName(name));
+    }
+  }
+  return sb_type;
+}
+
+lldb::SBType SBModule::GetBasicType(lldb::BasicType type) {
+  ModuleSP module_sp(GetSP());
+  if (module_sp) {
+    TypeSystem *type_system =
+        module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
+    if (type_system)
+      return SBType(type_system->GetBasicTypeFromAST(type));
+  }
+  return SBType();
+}
+
+lldb::SBTypeList SBModule::FindTypes(const char *type) {
+  SBTypeList retval;
+
+  ModuleSP module_sp(GetSP());
+  if (type && module_sp) {
+    SymbolContext sc;
+    TypeList type_list;
+    const bool exact_match = false;
+    ConstString name(type);
+    llvm::DenseSet<SymbolFile *> searched_symbol_files;
+    const uint32_t num_matches = module_sp->FindTypes(
+        sc, name, exact_match, UINT32_MAX, searched_symbol_files, type_list);
+
+    if (num_matches > 0) {
+      for (size_t idx = 0; idx < num_matches; idx++) {
+        TypeSP type_sp(type_list.GetTypeAtIndex(idx));
+        if (type_sp)
+          retval.Append(SBType(type_sp));
+      }
+    } else {
+      TypeSystem *type_system =
+          module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
+      if (type_system) {
+        CompilerType compiler_type = type_system->GetBuiltinTypeByName(name);
+        if (compiler_type)
+          retval.Append(SBType(compiler_type));
+      }
+    }
+  }
+
+  return retval;
+}
+
+lldb::SBType SBModule::GetTypeByID(lldb::user_id_t uid) {
+  ModuleSP module_sp(GetSP());
+  if (module_sp) {
+    SymbolVendor *vendor = module_sp->GetSymbolVendor();
+    if (vendor) {
+      Type *type_ptr = vendor->ResolveTypeUID(uid);
+      if (type_ptr)
+        return SBType(type_ptr->shared_from_this());
+    }
+  }
+  return SBType();
+}
+
+lldb::SBTypeList SBModule::GetTypes(uint32_t type_mask) {
+  SBTypeList sb_type_list;
+
+  ModuleSP module_sp(GetSP());
+  if (module_sp) {
+    SymbolVendor *vendor = module_sp->GetSymbolVendor();
+    if (vendor) {
+      TypeList type_list;
+      vendor->GetTypes(NULL, type_mask, type_list);
+      sb_type_list.m_opaque_ap->Append(type_list);
+    }
+  }
+  return sb_type_list;
+}
+
+SBSection SBModule::FindSection(const char *sect_name) {
+  SBSection sb_section;
+
+  ModuleSP module_sp(GetSP());
+  if (sect_name && module_sp) {
+    // Give the symbol vendor a chance to add to the unified section list.
+    module_sp->GetSymbolVendor();
+    SectionList *section_list = module_sp->GetSectionList();
+    if (section_list) {
+      ConstString const_sect_name(sect_name);
+      SectionSP section_sp(section_list->FindSectionByName(const_sect_name));
+      if (section_sp) {
+        sb_section.SetSP(section_sp);
+      }
+    }
+  }
+  return sb_section;
+}
+
+lldb::ByteOrder SBModule::GetByteOrder() {
+  ModuleSP module_sp(GetSP());
+  if (module_sp)
+    return module_sp->GetArchitecture().GetByteOrder();
+  return eByteOrderInvalid;
+}
+
+const char *SBModule::GetTriple() {
+  ModuleSP module_sp(GetSP());
+  if (module_sp) {
+    std::string triple(module_sp->GetArchitecture().GetTriple().str());
+    // Unique the string so we don't run into ownership issues since
+    // the const strings put the string into the string pool once and
+    // the strings never comes out
+    ConstString const_triple(triple.c_str());
+    return const_triple.GetCString();
+  }
+  return NULL;
+}
+
+uint32_t SBModule::GetAddressByteSize() {
+  ModuleSP module_sp(GetSP());
+  if (module_sp)
+    return module_sp->GetArchitecture().GetAddressByteSize();
+  return sizeof(void *);
+}
+
+uint32_t SBModule::GetVersion(uint32_t *versions, uint32_t num_versions) {
+  ModuleSP module_sp(GetSP());
+  if (module_sp)
+    return module_sp->GetVersion(versions, num_versions);
+  else {
+    if (versions && num_versions) {
+      for (uint32_t i = 0; i < num_versions; ++i)
+        versions[i] = UINT32_MAX;
     }
-    return sb_file_spec;
+    return 0;
+  }
 }
 
-lldb::SBAddress
-SBModule::GetObjectFileHeaderAddress() const
-{
-    lldb::SBAddress sb_addr;
-    ModuleSP module_sp (GetSP ());
-    if (module_sp)
-    {
-        ObjectFile *objfile_ptr = module_sp->GetObjectFile();
-        if (objfile_ptr)
-            sb_addr.ref() = objfile_ptr->GetHeaderAddress();
-    }
-    return sb_addr;
+lldb::SBFileSpec SBModule::GetSymbolFileSpec() const {
+  lldb::SBFileSpec sb_file_spec;
+  ModuleSP module_sp(GetSP());
+  if (module_sp) {
+    SymbolVendor *symbol_vendor_ptr = module_sp->GetSymbolVendor();
+    if (symbol_vendor_ptr)
+      sb_file_spec.SetFileSpec(symbol_vendor_ptr->GetMainFileSpec());
+  }
+  return sb_file_spec;
+}
+
+lldb::SBAddress SBModule::GetObjectFileHeaderAddress() const {
+  lldb::SBAddress sb_addr;
+  ModuleSP module_sp(GetSP());
+  if (module_sp) {
+    ObjectFile *objfile_ptr = module_sp->GetObjectFile();
+    if (objfile_ptr)
+      sb_addr.ref() = objfile_ptr->GetHeaderAddress();
+  }
+  return sb_addr;
 }

Modified: lldb/trunk/source/API/SBModuleSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBModuleSpec.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/source/API/SBModuleSpec.cpp (original)
+++ lldb/trunk/source/API/SBModuleSpec.cpp Tue Sep  6 15:57:50 2016
@@ -18,213 +18,140 @@
 using namespace lldb;
 using namespace lldb_private;
 
+SBModuleSpec::SBModuleSpec() : m_opaque_ap(new lldb_private::ModuleSpec()) {}
 
-SBModuleSpec::SBModuleSpec () :
-    m_opaque_ap (new lldb_private::ModuleSpec())
-{
-}
+SBModuleSpec::SBModuleSpec(const SBModuleSpec &rhs)
+    : m_opaque_ap(new lldb_private::ModuleSpec(*rhs.m_opaque_ap)) {}
 
-SBModuleSpec::SBModuleSpec(const SBModuleSpec &rhs) :
-    m_opaque_ap (new lldb_private::ModuleSpec(*rhs.m_opaque_ap))
-{
+const SBModuleSpec &SBModuleSpec::operator=(const SBModuleSpec &rhs) {
+  if (this != &rhs)
+    *m_opaque_ap = *(rhs.m_opaque_ap);
+  return *this;
 }
 
-const SBModuleSpec &
-SBModuleSpec::operator = (const SBModuleSpec &rhs)
-{
-    if (this != &rhs)
-        *m_opaque_ap = *(rhs.m_opaque_ap);
-    return *this;
-}
+SBModuleSpec::~SBModuleSpec() {}
 
-SBModuleSpec::~SBModuleSpec ()
-{
-}
+bool SBModuleSpec::IsValid() const { return m_opaque_ap->operator bool(); }
 
-bool
-SBModuleSpec::IsValid () const
-{
-    return m_opaque_ap->operator bool();
-}
+void SBModuleSpec::Clear() { m_opaque_ap->Clear(); }
 
-void
-SBModuleSpec::Clear()
-{
-    m_opaque_ap->Clear();
+SBFileSpec SBModuleSpec::GetFileSpec() {
+  SBFileSpec sb_spec(m_opaque_ap->GetFileSpec());
+  return sb_spec;
 }
 
-SBFileSpec
-SBModuleSpec::GetFileSpec ()
-{
-    SBFileSpec sb_spec(m_opaque_ap->GetFileSpec());
-    return sb_spec;
+void SBModuleSpec::SetFileSpec(const lldb::SBFileSpec &sb_spec) {
+  m_opaque_ap->GetFileSpec() = *sb_spec;
 }
 
-void
-SBModuleSpec::SetFileSpec (const lldb::SBFileSpec &sb_spec)
-{
-    m_opaque_ap->GetFileSpec() = *sb_spec;
+lldb::SBFileSpec SBModuleSpec::GetPlatformFileSpec() {
+  return SBFileSpec(m_opaque_ap->GetPlatformFileSpec());
 }
 
-lldb::SBFileSpec
-SBModuleSpec::GetPlatformFileSpec ()
-{
-    return SBFileSpec(m_opaque_ap->GetPlatformFileSpec());
+void SBModuleSpec::SetPlatformFileSpec(const lldb::SBFileSpec &sb_spec) {
+  m_opaque_ap->GetPlatformFileSpec() = *sb_spec;
 }
 
-void
-SBModuleSpec::SetPlatformFileSpec (const lldb::SBFileSpec &sb_spec)
-{
-    m_opaque_ap->GetPlatformFileSpec() = *sb_spec;
+lldb::SBFileSpec SBModuleSpec::GetSymbolFileSpec() {
+  return SBFileSpec(m_opaque_ap->GetSymbolFileSpec());
 }
 
-lldb::SBFileSpec
-SBModuleSpec::GetSymbolFileSpec ()
-{
-    return SBFileSpec(m_opaque_ap->GetSymbolFileSpec());
+void SBModuleSpec::SetSymbolFileSpec(const lldb::SBFileSpec &sb_spec) {
+  m_opaque_ap->GetSymbolFileSpec() = *sb_spec;
 }
 
-void
-SBModuleSpec::SetSymbolFileSpec (const lldb::SBFileSpec &sb_spec)
-{
-    m_opaque_ap->GetSymbolFileSpec() = *sb_spec;
+const char *SBModuleSpec::GetObjectName() {
+  return m_opaque_ap->GetObjectName().GetCString();
 }
 
-const char *
-SBModuleSpec::GetObjectName ()
-{
-    return m_opaque_ap->GetObjectName().GetCString();
+void SBModuleSpec::SetObjectName(const char *name) {
+  m_opaque_ap->GetObjectName().SetCString(name);
 }
 
-void
-SBModuleSpec::SetObjectName (const char *name)
-{
-    m_opaque_ap->GetObjectName().SetCString(name);
+const char *SBModuleSpec::GetTriple() {
+  std::string triple(m_opaque_ap->GetArchitecture().GetTriple().str());
+  // Unique the string so we don't run into ownership issues since
+  // the const strings put the string into the string pool once and
+  // the strings never comes out
+  ConstString const_triple(triple.c_str());
+  return const_triple.GetCString();
 }
 
-const char *
-SBModuleSpec::GetTriple ()
-{
-    std::string triple (m_opaque_ap->GetArchitecture().GetTriple().str());
-    // Unique the string so we don't run into ownership issues since
-    // the const strings put the string into the string pool once and
-    // the strings never comes out
-    ConstString const_triple (triple.c_str());
-    return const_triple.GetCString();
+void SBModuleSpec::SetTriple(const char *triple) {
+  m_opaque_ap->GetArchitecture().SetTriple(triple);
 }
 
-void
-SBModuleSpec::SetTriple (const char *triple)
-{
-    m_opaque_ap->GetArchitecture().SetTriple(triple);
+const uint8_t *SBModuleSpec::GetUUIDBytes() {
+  return (const uint8_t *)m_opaque_ap->GetUUID().GetBytes();
 }
 
-const uint8_t *
-SBModuleSpec::GetUUIDBytes ()
-{
-    return (const uint8_t *)m_opaque_ap->GetUUID().GetBytes();
+size_t SBModuleSpec::GetUUIDLength() {
+  return m_opaque_ap->GetUUID().GetByteSize();
 }
 
-size_t
-SBModuleSpec::GetUUIDLength ()
-{
-    return m_opaque_ap->GetUUID().GetByteSize();
+bool SBModuleSpec::SetUUIDBytes(const uint8_t *uuid, size_t uuid_len) {
+  return m_opaque_ap->GetUUID().SetBytes(uuid, uuid_len);
 }
 
-bool
-SBModuleSpec::SetUUIDBytes (const uint8_t *uuid, size_t uuid_len)
-{
-    return m_opaque_ap->GetUUID().SetBytes(uuid, uuid_len);
+bool SBModuleSpec::GetDescription(lldb::SBStream &description) {
+  m_opaque_ap->Dump(description.ref());
+  return true;
 }
 
-bool
-SBModuleSpec::GetDescription (lldb::SBStream &description)
-{
-    m_opaque_ap->Dump (description.ref());
-    return true;
-}
+SBModuleSpecList::SBModuleSpecList() : m_opaque_ap(new ModuleSpecList()) {}
 
-SBModuleSpecList::SBModuleSpecList() :
-    m_opaque_ap(new ModuleSpecList())
-{
-    
-}
+SBModuleSpecList::SBModuleSpecList(const SBModuleSpecList &rhs)
+    : m_opaque_ap(new ModuleSpecList(*rhs.m_opaque_ap)) {}
 
-SBModuleSpecList::SBModuleSpecList (const SBModuleSpecList &rhs) :
-    m_opaque_ap(new ModuleSpecList(*rhs.m_opaque_ap))
-{
-    
+SBModuleSpecList &SBModuleSpecList::operator=(const SBModuleSpecList &rhs) {
+  if (this != &rhs)
+    *m_opaque_ap = *rhs.m_opaque_ap;
+  return *this;
 }
 
-SBModuleSpecList &
-SBModuleSpecList::operator = (const SBModuleSpecList &rhs)
-{
-    if (this != &rhs)
-        *m_opaque_ap = *rhs.m_opaque_ap;
-    return *this;
+SBModuleSpecList::~SBModuleSpecList() {}
+
+SBModuleSpecList SBModuleSpecList::GetModuleSpecifications(const char *path) {
+  SBModuleSpecList specs;
+  FileSpec file_spec(path, true);
+  Host::ResolveExecutableInBundle(file_spec);
+  ObjectFile::GetModuleSpecifications(file_spec, 0, 0, *specs.m_opaque_ap);
+  return specs;
 }
 
-SBModuleSpecList::~SBModuleSpecList()
-{
-    
+void SBModuleSpecList::Append(const SBModuleSpec &spec) {
+  m_opaque_ap->Append(*spec.m_opaque_ap);
 }
 
-SBModuleSpecList
-SBModuleSpecList::GetModuleSpecifications (const char *path)
-{
-    SBModuleSpecList specs;
-    FileSpec file_spec(path, true);
-    Host::ResolveExecutableInBundle(file_spec);
-    ObjectFile::GetModuleSpecifications(file_spec, 0, 0, *specs.m_opaque_ap);
-    return specs;
-}
-
-void
-SBModuleSpecList::Append (const SBModuleSpec &spec)
-{
-    m_opaque_ap->Append (*spec.m_opaque_ap);
-}
-
-void
-SBModuleSpecList::Append (const SBModuleSpecList &spec_list)
-{
-    m_opaque_ap->Append (*spec_list.m_opaque_ap);
-}
-
-size_t
-SBModuleSpecList::GetSize()
-{
-    return m_opaque_ap->GetSize();
+void SBModuleSpecList::Append(const SBModuleSpecList &spec_list) {
+  m_opaque_ap->Append(*spec_list.m_opaque_ap);
 }
 
-SBModuleSpec
-SBModuleSpecList::GetSpecAtIndex (size_t i)
-{
-    SBModuleSpec sb_module_spec;
-    m_opaque_ap->GetModuleSpecAtIndex(i, *sb_module_spec.m_opaque_ap);
-    return sb_module_spec;
+size_t SBModuleSpecList::GetSize() { return m_opaque_ap->GetSize(); }
+
+SBModuleSpec SBModuleSpecList::GetSpecAtIndex(size_t i) {
+  SBModuleSpec sb_module_spec;
+  m_opaque_ap->GetModuleSpecAtIndex(i, *sb_module_spec.m_opaque_ap);
+  return sb_module_spec;
 }
 
 SBModuleSpec
-SBModuleSpecList::FindFirstMatchingSpec (const SBModuleSpec &match_spec)
-{
-    SBModuleSpec sb_module_spec;
-    m_opaque_ap->FindMatchingModuleSpec(*match_spec.m_opaque_ap, *sb_module_spec.m_opaque_ap);
-    return sb_module_spec;
+SBModuleSpecList::FindFirstMatchingSpec(const SBModuleSpec &match_spec) {
+  SBModuleSpec sb_module_spec;
+  m_opaque_ap->FindMatchingModuleSpec(*match_spec.m_opaque_ap,
+                                      *sb_module_spec.m_opaque_ap);
+  return sb_module_spec;
 }
 
 SBModuleSpecList
-SBModuleSpecList::FindMatchingSpecs (const SBModuleSpec &match_spec)
-{
-    SBModuleSpecList specs;
-    m_opaque_ap->FindMatchingModuleSpecs(*match_spec.m_opaque_ap, *specs.m_opaque_ap);
-    return specs;
-    
+SBModuleSpecList::FindMatchingSpecs(const SBModuleSpec &match_spec) {
+  SBModuleSpecList specs;
+  m_opaque_ap->FindMatchingModuleSpecs(*match_spec.m_opaque_ap,
+                                       *specs.m_opaque_ap);
+  return specs;
 }
 
-bool
-SBModuleSpecList::GetDescription (lldb::SBStream &description)
-{
-    m_opaque_ap->Dump (description.ref());
-    return true;
+bool SBModuleSpecList::GetDescription(lldb::SBStream &description) {
+  m_opaque_ap->Dump(description.ref());
+  return true;
 }




More information about the lldb-commits mailing list