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
1dab6095
Commit
1dab6095
authored
1 year ago
by
Thibault Martin
Committed by
Virgile Prevosto
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Add headers
parent
db48dc01
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_services/ast_queries/current_loc.ml
+23
-1
23 additions, 1 deletion
src/kernel_services/ast_queries/current_loc.ml
src/kernel_services/ast_queries/current_loc.mli
+23
-2
23 additions, 2 deletions
src/kernel_services/ast_queries/current_loc.mli
with
46 additions
and
3 deletions
src/kernel_services/ast_queries/current_loc.ml
+
23
−
1
View file @
1dab6095
(**************************************************************************)
(* *)
(* This file is part of Frama-C. *)
(* *)
(* Copyright (C) 2007-2023 *)
(* CEA (Commissariat à l'énergie atomique et aux énergies *)
(* alternatives) *)
(* *)
(* you can redistribute it and/or modify it under the terms of the GNU *)
(* Lesser General Public License as published by the Free Software *)
(* Foundation, version 2.1. *)
(* *)
(* It is distributed in the hope that it will be useful, *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)
(* GNU Lesser General Public License for more details. *)
(* *)
(* See the GNU Lesser General Public License version 2.1 *)
(* for more details (enclosed in the file licenses/LGPLv2.1). *)
(* *)
(**************************************************************************)
include
State_builder
.
Ref
include
State_builder
.
Ref
(
Cil_datatype
.
Location
)
(
Cil_datatype
.
Location
)
(
struct
(
struct
let
dependencies
=
[]
let
dependencies
=
[]
let
name
=
"Current
L
oc"
let
name
=
"Current
_l
oc"
let
default
()
=
Cil_datatype
.
Location
.
unknown
let
default
()
=
Cil_datatype
.
Location
.
unknown
end
)
end
)
...
...
This diff is collapsed.
Click to expand it.
src/kernel_services/ast_queries/current_loc.mli
+
23
−
2
View file @
1dab6095
(**************************************************************************)
(* *)
(* This file is part of Frama-C. *)
(* *)
(* Copyright (C) 2007-2023 *)
(* CEA (Commissariat à l'énergie atomique et aux énergies *)
(* alternatives) *)
(* *)
(* you can redistribute it and/or modify it under the terms of the GNU *)
(* Lesser General Public License as published by the Free Software *)
(* Foundation, version 2.1. *)
(* *)
(* It is distributed in the hope that it will be useful, *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)
(* GNU Lesser General Public License for more details. *)
(* *)
(* See the GNU Lesser General Public License version 2.1 *)
(* for more details (enclosed in the file licenses/LGPLv2.1). *)
(* *)
(**************************************************************************)
(** A reference to the current location. If you are careful to set this to
(** A reference to the current location. If you are careful to set this to
the current location then you can use some built-in logging functions that
the current location then you can use some built-in logging functions that
will print the location.
will print the location.
*)
*)
include
State_builder
.
Ref
with
type
data
=
Filepath
.
position
*
Filepath
.
position
include
State_builder
.
Ref
with
type
data
=
Filepath
.
position
*
Filepath
.
position
(** [with_loc loc f x] set the current location to [loc], which can be used
(** [with_loc loc f x] set the current location to [loc], which can be used
with [Current
L
oc.get ()] or via the option [~current] in Log functions.
with [Current
_l
oc.get ()] or via the option [~current] in Log functions.
The old location is saved and set back after exectution of [f x]. If [f x]
The old location is saved and set back after exectution of [f x]. If [f x]
raises an exception, it is caught and re-raised after setting the location
raises an exception, it is caught and re-raised after setting the location
to its old value.
to its old value.
...
...
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