Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Toolchain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Open Source Software
Zipr Toolchain
Commits
7db14102
Commit
7db14102
authored
6 years ago
by
Jason Hiser
Browse files
Options
Downloads
Patches
Plain Diff
more permissive switch detection for arm.
Former-commit-id: ee9fd233519e8352be75cb8cc1f830352e8dc9fe
parent
3b88b310
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
libIRDB/test/fill_in_indtargs.cpp
+29
-3
29 additions, 3 deletions
libIRDB/test/fill_in_indtargs.cpp
with
29 additions
and
3 deletions
libIRDB/test/fill_in_indtargs.cpp
+
29
−
3
View file @
7db14102
...
@@ -802,22 +802,48 @@ notes:
...
@@ -802,22 +802,48 @@ notes:
cout
<<
"
\t
Entry #"
<<
dec
<<
target_count
<<
"= ent-addr="
<<
hex
<<
entry_address
cout
<<
"
\t
Entry #"
<<
dec
<<
target_count
<<
"= ent-addr="
<<
hex
<<
entry_address
<<
" ent="
<<
hex
<<+
table_entry
// print as int, not char.
<<
" ent="
<<
hex
<<+
table_entry
// print as int, not char.
<<
" ibta="
<<
candidate_ibta
<<
endl
;
<<
" ibta="
<<
candidate_ibta
;
// stop if we failed to find an instruction,
// stop if we failed to find an instruction,
// or find an instruction outside the function
// or find an instruction outside the function
if
(
ibtarget
==
nullptr
||
ibtarget
->
GetFunction
()
!=
i10_func
)
if
(
ibtarget
==
nullptr
)
{
cout
<<
" -- no target insn!"
<<
endl
;
break
;
break
;
}
const
auto
ibtarget_func
=
ibtarget
->
GetFunction
();
if
(
i10_func
==
nullptr
)
{
// finding switch in non-function is OK.
}
else
if
(
ibtarget_func
==
nullptr
)
{
// finding target in non-function is OK
}
else
if
(
i10_func
!=
ibtarget_func
)
{
// finding switch in function to different function, not ok.
cout
<<
" -- switch to diff func? No."
<<
endl
;
}
// record that we found something that looks valid-enough to try to pin
// record that we found something that looks valid-enough to try to pin
// stop if we couldn't pin.
// stop if we couldn't pin.
if
(
!
possible_target
(
candidate_ibta
,
entry_address
,
prov
))
if
(
!
possible_target
(
candidate_ibta
,
entry_address
,
prov
))
{
cout
<<
" -- not possible target!"
<<
endl
;
break
;
break
;
}
cout
<<
" -- valid target!"
<<
endl
;
targets
.
insert
(
candidate_ibta
);
targets
.
insert
(
candidate_ibta
);
// this was running away when looking for byte-entries. occasionally there is no
// this was running away when looking for byte-entries. occasionally there is no
// byte offset that's not a valid instructoin, and we run until the end of the section.
// byte offset that's not a valid instructoin, and we run until the end of the section.
if
(
target_count
>
1024
)
break
;
if
(
target_count
>
1024
)
{
cout
<<
"Caution, exiting loop after 1024 valid entries."
<<
endl
;
break
;
}
}
}
cout
<<
"
\t
Unique target count="
<<
dec
<<
targets
.
size
()
<<
endl
;
cout
<<
"
\t
Unique target count="
<<
dec
<<
targets
.
size
()
<<
endl
;
return
target_count
>
1
;
return
target_count
>
1
;
...
...
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