Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tools
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
vendor
qcom-opensource
tools
Commits
bc936e8a
Commit
bc936e8a
authored
9 years ago
by
Linux Build Service Account
Committed by
Gerrit - the friendly Code Review server
9 years ago
Browse files
Options
Downloads
Plain Diff
Merge "lrdp-v2: Simplify some returns in the memory accessor code"
parents
b31534ba
ce13475e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
linux-ramdump-parser-v2/ramdump.py
+9
-36
9 additions, 36 deletions
linux-ramdump-parser-v2/ramdump.py
with
9 additions
and
36 deletions
linux-ramdump-parser-v2/ramdump.py
+
9
−
36
View file @
bc936e8a
...
...
@@ -1086,10 +1086,7 @@ class RamDump():
def
read_dword
(
self
,
address
,
virtual
=
True
,
cpu
=
None
):
s
=
self
.
read_string
(
address
,
'
<Q
'
,
virtual
,
cpu
)
if
s
is
None
:
return
None
else
:
return
s
[
0
]
return
s
[
0
]
if
s
is
not
None
else
None
# returns a word size (pointer) read from ramdump
def
read_word
(
self
,
address
,
virtual
=
True
,
cpu
=
None
):
...
...
@@ -1097,10 +1094,7 @@ class RamDump():
s
=
self
.
read_string
(
address
,
'
<Q
'
,
virtual
,
cpu
)
else
:
s
=
self
.
read_string
(
address
,
'
<I
'
,
virtual
,
cpu
)
if
s
is
None
:
return
None
else
:
return
s
[
0
]
return
s
[
0
]
if
s
is
not
None
else
None
# returns a value corresponding to half the word size
def
read_halfword
(
self
,
address
,
virtual
=
True
,
cpu
=
None
):
...
...
@@ -1108,48 +1102,30 @@ class RamDump():
s
=
self
.
read_string
(
address
,
'
<I
'
,
virtual
,
cpu
)
else
:
s
=
self
.
read_string
(
address
,
'
<H
'
,
virtual
,
cpu
)
if
s
is
None
:
return
None
else
:
return
s
[
0
]
return
s
[
0
]
if
s
is
not
None
else
None
def
read_byte
(
self
,
address
,
virtual
=
True
,
cpu
=
None
):
s
=
self
.
read_string
(
address
,
'
<B
'
,
virtual
,
cpu
)
if
s
is
None
:
return
None
else
:
return
s
[
0
]
return
s
[
0
]
if
s
is
not
None
else
None
def
read_bool
(
self
,
address
,
virtual
=
True
,
cpu
=
None
):
s
=
self
.
read_string
(
address
,
'
<?
'
,
virtual
,
cpu
)
if
s
is
None
:
return
None
else
:
return
s
[
0
]
return
s
[
0
]
if
s
is
not
None
else
None
# returns a value guaranteed to be 64 bits
def
read_u64
(
self
,
address
,
virtual
=
True
,
cpu
=
None
):
s
=
self
.
read_string
(
address
,
'
<Q
'
,
virtual
,
cpu
)
if
s
is
None
:
return
None
else
:
return
s
[
0
]
return
s
[
0
]
if
s
is
not
None
else
None
# returns a value guaranteed to be 32 bits
def
read_s32
(
self
,
address
,
virtual
=
True
,
cpu
=
None
):
s
=
self
.
read_string
(
address
,
'
<i
'
,
virtual
,
cpu
)
if
s
is
None
:
return
None
else
:
return
s
[
0
]
return
s
[
0
]
if
s
is
not
None
else
None
# returns a value guaranteed to be 32 bits
def
read_u32
(
self
,
address
,
virtual
=
True
,
cpu
=
None
):
s
=
self
.
read_string
(
address
,
'
<I
'
,
virtual
,
cpu
)
if
s
is
None
:
return
None
else
:
return
s
[
0
]
return
s
[
0
]
if
s
is
not
None
else
None
def
read_int
(
self
,
address
,
virtual
=
True
,
cpu
=
None
):
return
self
.
read_u32
(
address
,
virtual
,
cpu
)
...
...
@@ -1157,10 +1133,7 @@ class RamDump():
# returns a value guaranteed to be 16 bits
def
read_u16
(
self
,
address
,
virtual
=
True
,
cpu
=
None
):
s
=
self
.
read_string
(
address
,
'
<H
'
,
virtual
,
cpu
)
if
s
is
None
:
return
None
else
:
return
s
[
0
]
return
s
[
0
]
if
s
is
not
None
else
None
# reads a 4 or 8 byte field from a structure
def
read_structure_field
(
self
,
address
,
struct_name
,
field
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment