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.

llvm-svn: 251328
This commit is contained in:
Zachary Turner 2015-10-26 18:48:14 +00:00
parent 7b54b525cd
commit 1411668b6a
6 changed files with 14 additions and 14 deletions

View File

@ -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)

View File

@ -16,7 +16,7 @@ class TestGdbRemoteExpeditedRegisters(gdbremote_testcase.GdbRemoteTestCaseBase):
# 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)

View File

@ -36,7 +36,7 @@ class TestGdbRemoteThreadsInStopReply(gdbremote_testcase.GdbRemoteTestCaseBase):
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(gdbremote_testcase.GdbRemoteTestCaseBase):
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()

View File

@ -33,7 +33,7 @@ class TestGdbRemote_qThreadStopInfo(gdbremote_testcase.GdbRemoteTestCaseBase):
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()

View File

@ -865,7 +865,7 @@ class LldbGdbServerTestCase(gdbremote_testcase.GdbRemoteTestCaseBase):
# 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_testcase.GdbRemoteTestCaseBase):
# 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_testcase.GdbRemoteTestCaseBase):
# 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_testcase.GdbRemoteTestCaseBase):
# 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_testcase.GdbRemoteTestCaseBase):
# 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_testcase.GdbRemoteTestCaseBase):
# 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)

View File

@ -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)