Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
DIOT Monitoring Module
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
DIOT Monitoring Module
Commits
713b89ee
Commit
713b89ee
authored
Sep 12, 2019
by
Christos Gentsos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
General: add tiny utilities to ease reading / debugging asm listings
parent
8d9f057a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
asm_find_func.sh
utils/asm_find_func.sh
+13
-0
asm_find_val.sh
utils/asm_find_val.sh
+10
-0
No files found.
utils/asm_find_func.sh
0 → 100755
View file @
713b89ee
#!/usr/bin/bash
# The purpose of the script is to track down what function the assembly code calls.
# for example, for the call in the two lines below:
# 211a: 4b05 ldr r3, [pc, #20] ; (2130 <io_write+0x34>)
# 211c: 4798 blx r3
# the user would have to run `asm_find_func.sh listing_file.lss 2130` and they
# would learn that the function called here is "assert".
num
=
$(
grep
$2
:
"
$1
"
|
cut
-f2
)
numhex
=
0x
$(
echo
"ibase=16; obase=10;
${
num
^^
}
-1"
| bc
)
numhexwide
=
$(
printf
'%08x\n'
$numhex
)
grep
$numhexwide
"
$1
"
utils/asm_find_val.sh
0 → 100755
View file @
713b89ee
#!/usr/bin/bash
# The purpose of the script is to track down the value of a variable accessed
# in an assembly listing. for example, for the call in the line below:
# 61de: 4b25 ldr r3, [pc, #148] ; (6274 <float_to_linear+0xa8>)
# the user would have to run `asm_find_val.sh listing_file.lss 6274`
# to learn the value loaded to r3.
num
=
$(
grep
$2
:
"
$1
"
|
cut
-f2
)
printf
'%08x\n'
0x
$num
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