[Lldb-commits] [lldb] r251328 - Remove use of octal literals.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 26 11:48:15 PDT 2015


Author: zturner
Date: Mon Oct 26 13:48:14 2015
New Revision: 251328

URL: http://llvm.org/viewvc/llvm-project?rev=251328&view=rev
Log:
Remove use of octal literals.

Python 3 has a different syntax for octal literals than Python 2
and they are incompatible with each other.  Six doesn't provide
a transparent wrapper around this, so the most sane thing to do
is to not use octal literals.  If you need an octal literal,
use a decimal literal and if it's not obvious what the value is,
provide the value in octal as a comment.

Modified:
    lldb/trunk/test/lldbtest.py
    lldb/trunk/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py
    lldb/trunk/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py
    lldb/trunk/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py
    lldb/trunk/test/tools/lldb-server/TestLldbGdbServer.py
    lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py

Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=251328&r1=251327&r2=251328&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Mon Oct 26 13:48:14 2015
@@ -2433,7 +2433,7 @@ class TestBase(Base):
                     self.getArchitecture(),
                     str(self.test_number),
                     self.mydir)
-            error = lldb.remote_platform.MakeDirectory(remote_test_dir, 0700)
+            error = lldb.remote_platform.MakeDirectory(remote_test_dir, 448) # 448 = 0o700
             if error.Success():
                 lldb.remote_platform.SetWorkingDirectory(remote_test_dir)
 

Modified: lldb/trunk/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py?rev=251328&r1=251327&r2=251328&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py (original)
+++ lldb/trunk/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py Mon Oct 26 13:48:14 2015
@@ -16,7 +16,7 @@ class TestGdbRemoteExpeditedRegisters(gd
             # Start up the inferior.
             "read packet: $c#63",
             # Immediately tell it to stop.  We want to see what it reports.
-            "read packet: {}".format(chr(03)),
+            "read packet: {}".format(chr(3)),
             {"direction":"send", "regex":r"^\$T([0-9a-fA-F]+)([^#]+)#[0-9a-fA-F]{2}$", "capture":{1:"stop_result", 2:"key_vals_text"} },
             ], True)
 

Modified: lldb/trunk/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py?rev=251328&r1=251327&r2=251328&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py (original)
+++ lldb/trunk/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py Mon Oct 26 13:48:14 2015
@@ -36,7 +36,7 @@ class TestGdbRemoteThreadsInStopReply(gd
         time.sleep(1)
         self.reset_test_sequence()
         self.test_sequence.add_log_lines([
-            "read packet: {}".format(chr(03)),
+            "read packet: {}".format(chr(3)),
             {"direction":"send", "regex":r"^\$T([0-9a-fA-F]+)([^#]+)#[0-9a-fA-F]{2}$", "capture":{1:"stop_result", 2:"key_vals_text"} },
             ], True)
         context = self.expect_gdbremote_sequence()
@@ -51,7 +51,7 @@ class TestGdbRemoteThreadsInStopReply(gd
         self.reset_test_sequence()
         self.test_sequence.add_log_lines([
             "read packet: $c#63",
-            "read packet: {}".format(chr(03)),
+            "read packet: {}".format(chr(3)),
             {"direction":"send", "regex":r"^\$T([0-9a-fA-F]+)([^#]+)#[0-9a-fA-F]{2}$", "capture":{1:"stop_result", 2:"key_vals_text"} },
             ], True)
         context = self.expect_gdbremote_sequence()

Modified: lldb/trunk/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py?rev=251328&r1=251327&r2=251328&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py (original)
+++ lldb/trunk/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py Mon Oct 26 13:48:14 2015
@@ -33,7 +33,7 @@ class TestGdbRemote_qThreadStopInfo(gdbr
         time.sleep(1)
         self.reset_test_sequence()
         self.test_sequence.add_log_lines([
-            "read packet: {}".format(chr(03)),
+            "read packet: {}".format(chr(3)),
             {"direction":"send", "regex":r"^\$T([0-9a-fA-F]+)([^#]+)#[0-9a-fA-F]{2}$", "capture":{1:"stop_result", 2:"key_vals_text"} },
             ], True)
         context = self.expect_gdbremote_sequence()

Modified: lldb/trunk/test/tools/lldb-server/TestLldbGdbServer.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-server/TestLldbGdbServer.py?rev=251328&r1=251327&r2=251328&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-server/TestLldbGdbServer.py (original)
+++ lldb/trunk/test/tools/lldb-server/TestLldbGdbServer.py Mon Oct 26 13:48:14 2015
@@ -865,7 +865,7 @@ class LldbGdbServerTestCase(gdbremote_te
              # Note we require launch-only testing so we can get inferior otuput.
              { "type":"output_match", "regex":r"^data address: 0x([0-9a-fA-F]+)\r\n$", "capture":{ 1:"message_address"} },
              # Now stop the inferior.
-             "read packet: {}".format(chr(03)),
+             "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)
@@ -947,7 +947,7 @@ class LldbGdbServerTestCase(gdbremote_te
              # 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\n$", "capture":{ 1:"code_address"} },
              # Now stop the inferior.
-             "read packet: {}".format(chr(03)),
+             "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)
@@ -1008,7 +1008,7 @@ class LldbGdbServerTestCase(gdbremote_te
              # Note we require launch-only testing so we can get inferior otuput.
              { "type":"output_match", "regex":r"^stack address: 0x([0-9a-fA-F]+)\r\n$", "capture":{ 1:"stack_address"} },
              # Now stop the inferior.
-             "read packet: {}".format(chr(03)),
+             "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)
@@ -1069,7 +1069,7 @@ class LldbGdbServerTestCase(gdbremote_te
              # Note we require launch-only testing so we can get inferior otuput.
              { "type":"output_match", "regex":r"^heap address: 0x([0-9a-fA-F]+)\r\n$", "capture":{ 1:"heap_address"} },
              # Now stop the inferior.
-             "read packet: {}".format(chr(03)),
+             "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)
@@ -1132,7 +1132,7 @@ class LldbGdbServerTestCase(gdbremote_te
              # 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\n$", "capture":{ 1:"function_address"} },
              # Now stop the inferior.
-             "read packet: {}".format(chr(03)),
+             "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)
@@ -1275,7 +1275,7 @@ class LldbGdbServerTestCase(gdbremote_te
              # Note we require launch-only testing so we can get inferior otuput.
              { "type":"output_match", "regex":r"^data address: 0x([0-9a-fA-F]+)\r\n$", "capture":{ 1:"message_address"} },
              # Now stop the inferior.
-             "read packet: {}".format(chr(03)),
+             "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)

Modified: lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py?rev=251328&r1=251327&r2=251328&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py (original)
+++ lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py Mon Oct 26 13:48:14 2015
@@ -774,7 +774,7 @@ class GdbRemoteTestCaseBase(TestBase):
         # Send an interrupt, capture a T response.
         self.reset_test_sequence()
         self.test_sequence.add_log_lines(
-            ["read packet: {}".format(chr(03)),
+            ["read packet: {}".format(chr(3)),
              {"direction":"send", "regex":r"^\$T([0-9a-fA-F]+)([^#]+)#[0-9a-fA-F]{2}$", "capture":{1:"stop_result"} }],
             True)
         context = self.expect_gdbremote_sequence()
@@ -923,7 +923,7 @@ class GdbRemoteTestCaseBase(TestBase):
     def add_interrupt_packets(self):
         self.test_sequence.add_log_lines([
             # Send the intterupt.
-            "read packet: {}".format(chr(03)),
+            "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)
@@ -1209,7 +1209,7 @@ class GdbRemoteTestCaseBase(TestBase):
              { "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(03)),
+             "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)




More information about the lldb-commits mailing list