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
028339e2
There was an error fetching the commit references. Please try again later.
Commit
028339e2
authored
5 years ago
by
Petr Rockai
Browse files
Options
Downloads
Patches
Plain Diff
libc: Improve presentation of assertion failures in counterexample traces.
parent
31462b9c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dios/include/assert.h
+5
-6
5 additions, 6 deletions
dios/include/assert.h
dios/libc/_PDCLIB/assert.c
+4
-3
4 additions, 3 deletions
dios/libc/_PDCLIB/assert.c
with
9 additions
and
9 deletions
dios/include/assert.h
+
5
−
6
View file @
028339e2
...
...
@@ -13,17 +13,16 @@
#undef _assert
#ifdef NDEBUG
# define
assert(e)
((void)0)
# define
_assert(e)
((void)0)
# define
assert(e)
((void)0)
# define
_assert(e)
((void)0)
#else
# define
_assert(e)
assert(e)
# define
assert(e)
(
(e) ? (void)0 : __assert_fail(#e, __FILE__, __LINE__, __
func
__))
# define
_assert(e)
assert(e)
# define
assert(e)
(
(e) ? (void)
0 : __assert_fail(#e, __FILE__, __LINE__, __
PRETTY_FUNCTION
__)
)
#endif
#ifndef _ASSERT_H_
#define _ASSERT_H_
__BEGIN_DECLS
void
__assert_fail
(
const
char
*
__assertion
,
const
char
*
__file
,
unsigned
int
__line
,
const
char
*
__function
)
_PDCLIB_nothrow
;
void
__assert_fail
(
const
char
*
,
const
char
*
,
unsigned
,
const
char
*
)
__nothrow
;
__END_DECLS
#endif
This diff is collapsed.
Click to expand it.
dios/libc/_PDCLIB/assert.c
+
4
−
3
View file @
028339e2
...
...
@@ -15,10 +15,11 @@
#include
<_PDCLIB/cdefs.h>
void
__assert_fail
(
const
char
*
__assertion
,
const
char
*
__
file
,
unsigned
int
__
line
,
const
char
*
__functio
n
)
void
__assert_fail
(
const
char
*
stmt
,
const
char
*
file
,
unsigned
line
,
const
char
*
fu
n
)
{
__dios_trace_f
(
"Assertion failed: %s, file %s, line %u."
,
__assertion
,
__file
,
__line
);
__dios_fault
(
_VM_F_Assert
,
NULL
);
char
buffer
[
200
];
snprintf
(
buffer
,
200
,
"%s:%u: %s: assertion '%s' failed"
,
file
,
line
,
fun
,
stmt
);
__dios_fault
(
_VM_F_Assert
,
buffer
);
}
#endif
...
...
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