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
f2206c1a
Commit
f2206c1a
authored
4 years ago
by
Valentin Perrelle
Committed by
Andre Maroneze
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[kernel] allow the Frama-C configuration to be dumped to stdout
parent
a36937b7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/kernel_internals/runtime/dump_config.ml
+33
-31
33 additions, 31 deletions
src/kernel_internals/runtime/dump_config.ml
src/kernel_internals/runtime/dump_config.mli
+4
-1
4 additions, 1 deletion
src/kernel_internals/runtime/dump_config.mli
with
37 additions
and
32 deletions
src/kernel_internals/runtime/dump_config.ml
+
33
−
31
View file @
f2206c1a
...
...
@@ -20,38 +20,41 @@
(* *)
(**************************************************************************)
let
dump_to_stdout
()
=
let
dump_to_json
()
=
let
string
s
=
`String
s
in
let
list
f
l
=
`List
(
List
.
map
f
l
)
in
let
json
=
`Assoc
[
"version"
,
`String
Fc_config
.
version
;
"codename"
,
`String
Fc_config
.
codename
;
"version_and_codename"
,
`String
Fc_config
.
version_and_codename
;
"major_version"
,
`Int
Fc_config
.
major_version
;
"minor_version"
,
`Int
Fc_config
.
minor_version
;
"is_gui"
,
`Bool
!
Fc_config
.
is_gui
;
"ocamlc"
,
`String
Fc_config
.
ocamlc
;
"ocamlopt"
,
`String
Fc_config
.
ocamlopt
;
"ocaml_wflags"
,
`String
Fc_config
.
ocaml_wflags
;
"datadir"
,
`String
Fc_config
.
datadir
;
"datadirs"
,
list
string
Fc_config
.
datadirs
;
"framac_libc"
,
`String
Fc_config
.
framac_libc
;
"libdir"
,
`String
Fc_config
.
libdir
;
"plugin_dir"
,
list
string
Fc_config
.
plugin_dir
;
"plugin_path"
,
`String
Fc_config
.
plugin_path
;
"compilation_unit_names"
,
list
string
Fc_config
.
compilation_unit_names
;
"library_names"
,
list
string
Fc_config
.
library_names
;
"preprocessor"
,
`String
Fc_config
.
preprocessor
;
"using_default_cpp"
,
`Bool
Fc_config
.
using_default_cpp
;
"preprocessor_is_gnu_like"
,
`Bool
Fc_config
.
preprocessor_is_gnu_like
;
"preprocessor_supported_arch_options"
,
list
string
Fc_config
.
preprocessor_supported_arch_options
;
"preprocessor_keep_comments"
,
`Bool
Fc_config
.
preprocessor_keep_comments
;
"dot"
,
(
match
Fc_config
.
dot
with
Some
cmd
->
`String
cmd
|
None
->
`Null
)
;
"current_machdep"
,
`String
(
Kernel
.
Machdep
.
get
()
)
;
"machdeps"
,
list
string
(
File
.
list_available_machdeps
()
)
]
in
`Assoc
[
"version"
,
`String
Fc_config
.
version
;
"codename"
,
`String
Fc_config
.
codename
;
"version_and_codename"
,
`String
Fc_config
.
version_and_codename
;
"major_version"
,
`Int
Fc_config
.
major_version
;
"minor_version"
,
`Int
Fc_config
.
minor_version
;
"is_gui"
,
`Bool
!
Fc_config
.
is_gui
;
"ocamlc"
,
`String
Fc_config
.
ocamlc
;
"ocamlopt"
,
`String
Fc_config
.
ocamlopt
;
"ocaml_wflags"
,
`String
Fc_config
.
ocaml_wflags
;
"datadir"
,
`String
Fc_config
.
datadir
;
"datadirs"
,
list
string
Fc_config
.
datadirs
;
"framac_libc"
,
`String
Fc_config
.
framac_libc
;
"libdir"
,
`String
Fc_config
.
libdir
;
"plugin_dir"
,
list
string
Fc_config
.
plugin_dir
;
"plugin_path"
,
`String
Fc_config
.
plugin_path
;
"compilation_unit_names"
,
list
string
Fc_config
.
compilation_unit_names
;
"library_names"
,
list
string
Fc_config
.
library_names
;
"preprocessor"
,
`String
Fc_config
.
preprocessor
;
"using_default_cpp"
,
`Bool
Fc_config
.
using_default_cpp
;
"preprocessor_is_gnu_like"
,
`Bool
Fc_config
.
preprocessor_is_gnu_like
;
"preprocessor_supported_arch_options"
,
list
string
Fc_config
.
preprocessor_supported_arch_options
;
"preprocessor_keep_comments"
,
`Bool
Fc_config
.
preprocessor_keep_comments
;
"dot"
,
(
match
Fc_config
.
dot
with
Some
cmd
->
`String
cmd
|
None
->
`Null
)
;
"current_machdep"
,
`String
(
Kernel
.
Machdep
.
get
()
)
;
"machdeps"
,
list
string
(
File
.
list_available_machdeps
()
)
]
let
dump_to_stdout
()
=
let
json
=
dump_to_json
()
in
Yojson
.
Basic
.
pretty_to_channel
stdout
json
let
()
=
...
...
@@ -63,4 +66,3 @@ let () =
Cmdline
.
nop
in
Cmdline
.
run_after_exiting_stage
action
This diff is collapsed.
Click to expand it.
src/kernel_internals/runtime/dump_config.mli
+
4
−
1
View file @
f2206c1a
...
...
@@ -20,5 +20,8 @@
(* *)
(**************************************************************************)
val
dump_to_json
:
unit
->
Yojson
.
Basic
.
t
(** Builds a Json object describing the Frama-C configuration *)
val
dump_to_stdout
:
unit
->
unit
(** Dumps a Json object describing the Frama-C configuration *)
(** Dumps a Json object
to
describing the Frama-C configuration
to stdout
*)
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