Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Jessica Clarke
morello-llvm-project
Commits
ac9ed7f1
Commit
ac9ed7f1
authored
Nov 20, 2020
by
Diana Picus
Browse files
[Morello][lldb] TestCapabilityOperation.py -> Python3
Fix some python2-isms related to mixing str and bytes.
parent
21120c9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
24 deletions
+24
-24
lldb/packages/Python/lldbsuite/test/functionalities/aarch64/capability-operation/TestCapabilityOperation.py
...s/aarch64/capability-operation/TestCapabilityOperation.py
+23
-23
lldb/packages/Python/lldbsuite/test/lldbsmock.py
lldb/packages/Python/lldbsuite/test/lldbsmock.py
+1
-1
No files found.
lldb/packages/Python/lldbsuite/test/functionalities/aarch64/capability-operation/TestCapabilityOperation.py
View file @
ac9ed7f1
...
...
@@ -192,8 +192,8 @@ class MorelloCapabilityOperationTestCase(CapabilityOperationTestBase):
self
.
assertTrue
(
error
.
Success
())
self
.
assertEqual
(
len
(
content
),
16
)
self
.
assertEqual
(
content
,
'
\x10\x00\x00\x80\x00\x00\x00\x00
'
'
\x20\x00\x00\x40\x00\xc0\x50\xdf
'
)
b
'
\x10\x00\x00\x80\x00\x00\x00\x00
'
b
'
\x20\x00\x00\x40\x00\xc0\x50\xdf
'
)
# Test read at the same address but this time as a tagged one.
content
=
process
.
ReadMemory
(
0x400
,
17
,
error
,
...
...
@@ -201,9 +201,9 @@ class MorelloCapabilityOperationTestCase(CapabilityOperationTestBase):
self
.
assertTrue
(
error
.
Success
())
self
.
assertEqual
(
len
(
content
),
17
)
self
.
assertEqual
(
content
,
'
\x01
'
'
\x10\x00\x00\x80\x00\x00\x00\x00
'
'
\x20\x00\x00\x40\x00\xc0\x50\xdf
'
)
b
'
\x01
'
b
'
\x10\x00\x00\x80\x00\x00\x00\x00
'
b
'
\x20\x00\x00\x40\x00\xc0\x50\xdf
'
)
# Test tagged read of more than one value.
content
=
process
.
ReadMemory
(
0x460
,
34
,
error
,
...
...
@@ -211,12 +211,12 @@ class MorelloCapabilityOperationTestCase(CapabilityOperationTestBase):
self
.
assertTrue
(
error
.
Success
())
self
.
assertEqual
(
len
(
content
),
34
)
self
.
assertEqual
(
content
,
'
\x00
'
'
\x00\x01\x00\x80\x00\x00\x00\x00
'
'
\x00\x02\x00\x40\x00\xc0\x50\xdf
'
'
\x01
'
'
\x10\x00\x00\x00\x00\x00\x00\x00
'
'
\x10\x00\x20\x40\x00\xc0\x50\xdf
'
)
b
'
\x00
'
b
'
\x00\x01\x00\x80\x00\x00\x00\x00
'
b
'
\x00\x02\x00\x40\x00\xc0\x50\xdf
'
b
'
\x01
'
b
'
\x10\x00\x00\x00\x00\x00\x00\x00
'
b
'
\x10\x00\x20\x40\x00\xc0\x50\xdf
'
)
# Test that software breakpoint opcodes are replaced with the original
# data - 1. A64 address.
...
...
@@ -234,12 +234,12 @@ class MorelloCapabilityOperationTestCase(CapabilityOperationTestBase):
self
.
assertTrue
(
error
.
Success
())
self
.
assertEqual
(
len
(
content
),
34
)
self
.
assertEqual
(
content
,
'
\x01
'
'
\x10\x00\x00\x80\x00\x00\x00\x00
'
'
\x20\x00\x00\x40\x00\xc0\x50\xdf
'
'
\x01
'
'
\x08\x00\x00\x80\x00\x00\x00\x00
'
'
\x20\x00\x00\x40\x00\xc0\x50\xdf
'
)
b
'
\x01
'
b
'
\x10\x00\x00\x80\x00\x00\x00\x00
'
b
'
\x20\x00\x00\x40\x00\xc0\x50\xdf
'
b
'
\x01
'
b
'
\x08\x00\x00\x80\x00\x00\x00\x00
'
b
'
\x20\x00\x00\x40\x00\xc0\x50\xdf
'
)
process
.
GetTarget
().
DeleteAllBreakpoints
()
# Test that software breakpoint opcodes are replaced with the original
...
...
@@ -260,12 +260,12 @@ class MorelloCapabilityOperationTestCase(CapabilityOperationTestBase):
self
.
assertTrue
(
error
.
Success
())
self
.
assertEqual
(
len
(
content
),
34
)
self
.
assertEqual
(
content
,
'
\x01
'
'
\x10\x00\x00\x80\x00\x00\x00\x00
'
'
\x20\x00\x00\x40\x00\xc0\x50\xdf
'
'
\x01
'
'
\x08\x00\x00\x80\x00\x00\x00\x00
'
'
\x20\x00\x00\x40\x00\xc0\x50\xdf
'
)
b
'
\x01
'
b
'
\x10\x00\x00\x80\x00\x00\x00\x00
'
b
'
\x20\x00\x00\x40\x00\xc0\x50\xdf
'
b
'
\x01
'
b
'
\x08\x00\x00\x80\x00\x00\x00\x00
'
b
'
\x20\x00\x00\x40\x00\xc0\x50\xdf
'
)
process
.
GetTarget
().
DeleteAllBreakpoints
()
...
...
lldb/packages/Python/lldbsuite/test/lldbsmock.py
View file @
ac9ed7f1
...
...
@@ -290,7 +290,7 @@ class Register(object):
return
b
'E01'
if
byte_order
==
'little'
:
hexvalue
=
''
.
join
(
reversed
(
hexvalue
=
b
''
.
join
(
reversed
(
[
hexvalue
[
i
:
i
+
2
]
for
i
in
range
(
0
,
len
(
hexvalue
),
2
)]))
self
.
write
(
int
(
hexvalue
,
16
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment