Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DIVINE
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
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
paradise
mirror
DIVINE
Commits
71915398
There was an error fetching the commit references. Please try again later.
Commit
71915398
authored
5 years ago
by
Lukáš Korenčik
Browse files
Options
Downloads
Patches
Plain Diff
ra: Add method that returns stack trace of counter-example.
parent
95b45ace
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
divine/ra/llvmrefine.hpp
+43
-0
43 additions, 0 deletions
divine/ra/llvmrefine.hpp
with
43 additions
and
0 deletions
divine/ra/llvmrefine.hpp
+
43
−
0
View file @
71915398
...
...
@@ -40,6 +40,8 @@ namespace divine::ra {
struct
get_ce_t_
{
using
stack_trace_t
=
std
::
vector
<
llvm
::
Instruction
*
>
;
template
<
typename
Ctx
>
void
static
create_ctx
(
Ctx
&
dbg_ctx
,
mc
::
Job
&
job
)
{
...
...
@@ -66,6 +68,47 @@ struct get_ce_t_
return
std
::
move
(
dbg_ctx
);
}
static
stack_trace_t
stack_trace
(
mc
::
Job
&
job
,
mc
::
BitCode
*
bc
)
{
dbg
::
Info
info
(
*
bc
->
_program
,
*
bc
->
_module
);
dbg
::
Context
<
vm
::
CowHeap
>
dbg_ctx
(
bc
->
program
(),
bc
->
debug
()
);
create_ctx
(
dbg_ctx
,
job
);
return
stack_trace
(
dbg_ctx
,
info
);
}
template
<
typename
dbg_ctx_t
>
static
stack_trace_t
stack_trace
(
dbg_ctx_t
&
dbg_ctx
,
dbg
::
Info
&
info
)
{
stack_trace_t
out
;
auto
&
heap
=
dbg_ctx
.
heap
();
vm
::
PointerV
current_pc
;
vm
::
PointerV
current_parent
;
vm
::
PointerV
iter_frame
(
dbg_ctx
.
frame
()
);
while
(
!
iter_frame
.
cooked
().
null
()
)
{
heap
.
read_shift
(
iter_frame
,
current_pc
);
auto
[
inst
,
pc
]
=
info
.
find
(
nullptr
,
current_pc
.
cooked
()
);
out
.
push_back
(
inst
);
heap
.
read_shift
(
iter_frame
,
current_parent
);
iter_frame
=
current_parent
;
}
return
out
;
}
template
<
typename
Stream
>
static
Stream
&
trace
(
Stream
&
os
,
const
stack_trace_t
&
stack_trace
)
{
os
<<
"Stack trace:"
<<
std
::
endl
;
for
(
auto
frame
:
stack_trace
)
os
<<
"
\t
"
<<
(
frame
?
frame
->
getFunction
()
->
getName
().
str
()
:
"nullptr"
)
<<
std
::
endl
;
return
os
;
}
};
template
<
typename
refiner_t
>
...
...
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