Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
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
pub
frama-c
Commits
30ff4e8b
Commit
30ff4e8b
authored
9 years ago
by
Kostyantyn Vorobyov
Browse files
Options
Downloads
Patches
Plain Diff
Added -q|--quiet option to e-acsl for quiet executions that output only
errors or warnings
parent
8f663dc7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/e-acsl/scripts/e-acsl-gcc.sh
+17
-7
17 additions, 7 deletions
src/plugins/e-acsl/scripts/e-acsl-gcc.sh
with
17 additions
and
7 deletions
src/plugins/e-acsl/scripts/e-acsl-gcc.sh
+
17
−
7
View file @
30ff4e8b
...
...
@@ -46,9 +46,9 @@ check_tool() {
# Getopt options
LONGOPTIONS
=
"help,compile,compile-only,print,debug:,ocode:,oexec:,verbose:,
\
frama-c-only,extra-cpp-args,rtl,frama-c-stdlib,full-mmodel,gmp,
frama-c-only,extra-cpp-args,rtl,frama-c-stdlib,full-mmodel,gmp,
quiet,
ld-flags:,cpp-flags:"
SHORTOPTIONS
=
"h,c,C,p,d:,o:,O:,v:,f,E:,R,L,M,l:,e:,g"
SHORTOPTIONS
=
"h,c,C,p,d:,o:,O:,v:,f,E:,R,L,M,l:,e:,g
,q
"
# Prefix for an error message due to wrong arguments
ERROR
=
"ERROR parsing arguments:"
...
...
@@ -105,6 +105,7 @@ EACSL_CPP_FLAGS="
EACSL_LD_FLAGS
=
"-lgmp -lm"
# Variables holding getopt options
OPTION_ECHO
=
"set -x"
# Echo executed commands to STDOUT
OPTION_INSTRUMENT
=
1
# Perform E-ACSL instrumentation
OPTION_PRINT
=
# Output instrumented code
OPTION_DEBUG
=
# Set frama-c debug flag
...
...
@@ -162,6 +163,8 @@ manpage() {
echo
" pass the specified flags to the linker"
echo
" -e, --cpp-flags <FLAGS>"
echo
" pass the specified flags to the pre-processor (compile-time)"
echo
" -q, --quiet"
echo
" suppress any output except for errors and warnings"
echo
""
echo
"EXAMPLES:"
echo
" # Instrument foo.c and output the instrumented code to a.out.frama.c"
...
...
@@ -203,6 +206,13 @@ do
shift
;
manpage
;
;;
# Do not echo commands to STDOUT
--quiet
|
-q
)
shift
;
OPTION_ECHO
=
OPTION_DEBUG
=
"-debug 0"
OPTION_VERBOSE
=
"-verbose 0"
;;
# Do compile instrumented code
--compile
|
-c
)
shift
;
...
...
@@ -309,7 +319,7 @@ fi
# Instrument
if
[
-n
"
$OPTION_INSTRUMENT
"
]
;
then
(
set
-x
;
\
(
$OPTION_ECHO
;
\
$FRAMAC
\
$FRAMAC_FLAGS
\
$MACHDEP
\
...
...
@@ -336,14 +346,14 @@ if test -n "$OPTION_COMPILE" ; then
# Compile the original files only if the instrumentation option is given,
# otherwise the provided sources are assumed to be E-ACSL instrumented files
if
[
-n
"
$OPTION_INSTRUMENT
"
]
;
then
(
set
-x
;
$CC
$CPPFLAGS
$CFLAGS
"
$@
"
-o
"
$OPTION_OEXEC
"
$LDFLAGS
)
;
error
"fail to compile/link un-instrumented code"
$?
;
(
$OPTION_ECHO
;
$CC
$CPPFLAGS
$CFLAGS
"
$@
"
-o
"
$OPTION_OEXEC
"
$LDFLAGS
)
;
error
"fail to compile/link un-instrumented code
:
$@
"
$?
;
else
OPTION_OCODE
=
"
$@
"
fi
# Compile and link E-ACSL-instrumented file
(
set
-x
;
$CC
$CPPFLAGS
$CFLAGS
$EACSL_CPP_FLAGS
$RTL
\
(
$OPTION_ECHO
;
$CC
$CPPFLAGS
$CFLAGS
$EACSL_CPP_FLAGS
$RTL
\
"
$OPTION_OCODE
"
-o
"
$OPTION_OEXEC
.e-acsl"
$LDFLAGS
$EACSL_LD_FLAGS
)
error
"fail to compile/link instrumented code"
$?
;
error
"fail to compile/link instrumented code
:
$@
"
$?
;
fi
exit
0
;
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