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
08af7e8d
Commit
08af7e8d
authored
2 years ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[server] Adds a boolean isFunctionPointer to marker attributes.
parent
c611520d
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
ivette/src/frama-c/kernel/api/ast/index.ts
+8
-3
8 additions, 3 deletions
ivette/src/frama-c/kernel/api/ast/index.ts
src/plugins/server/kernel_ast.ml
+15
-0
15 additions, 0 deletions
src/plugins/server/kernel_ast.ml
with
23 additions
and
3 deletions
ivette/src/frama-c/kernel/api/ast/index.ts
+
8
−
3
View file @
08af7e8d
...
@@ -147,6 +147,8 @@ export interface markerAttributesData {
...
@@ -147,6 +147,8 @@ export interface markerAttributesData {
isLval
:
boolean
;
isLval
:
boolean
;
/** Whether it is a function symbol */
/** Whether it is a function symbol */
isFunction
:
boolean
;
isFunction
:
boolean
;
/** Whether it is a function pointer */
isFunctionPointer
:
boolean
;
/** Whether it is a function declaration */
/** Whether it is a function declaration */
isFunDecl
:
boolean
;
isFunDecl
:
boolean
;
/** Function scope of the marker, if applicable */
/** Function scope of the marker, if applicable */
...
@@ -165,6 +167,7 @@ export const jMarkerAttributesData: Json.Decoder<markerAttributesData> =
...
@@ -165,6 +167,7 @@ export const jMarkerAttributesData: Json.Decoder<markerAttributesData> =
descr
:
Json
.
jString
,
descr
:
Json
.
jString
,
isLval
:
Json
.
jBoolean
,
isLval
:
Json
.
jBoolean
,
isFunction
:
Json
.
jBoolean
,
isFunction
:
Json
.
jBoolean
,
isFunctionPointer
:
Json
.
jBoolean
,
isFunDecl
:
Json
.
jBoolean
,
isFunDecl
:
Json
.
jBoolean
,
scope
:
Json
.
jOption
(
Json
.
jString
),
scope
:
Json
.
jOption
(
Json
.
jString
),
sloc
:
Json
.
jOption
(
jSource
),
sloc
:
Json
.
jOption
(
jSource
),
...
@@ -175,7 +178,8 @@ export const byMarkerAttributesData: Compare.Order<markerAttributesData> =
...
@@ -175,7 +178,8 @@ export const byMarkerAttributesData: Compare.Order<markerAttributesData> =
Compare
.
byFields
Compare
.
byFields
<
{
marker
:
marker
,
labelKind
:
string
,
titleKind
:
string
,
name
:
string
,
<
{
marker
:
marker
,
labelKind
:
string
,
titleKind
:
string
,
name
:
string
,
descr
:
string
,
isLval
:
boolean
,
isFunction
:
boolean
,
descr
:
string
,
isLval
:
boolean
,
isFunction
:
boolean
,
isFunDecl
:
boolean
,
scope
?:
string
,
sloc
?:
source
}
>
({
isFunctionPointer
:
boolean
,
isFunDecl
:
boolean
,
scope
?:
string
,
sloc
?:
source
}
>
({
marker
:
byMarker
,
marker
:
byMarker
,
labelKind
:
Compare
.
alpha
,
labelKind
:
Compare
.
alpha
,
titleKind
:
Compare
.
alpha
,
titleKind
:
Compare
.
alpha
,
...
@@ -183,6 +187,7 @@ export const byMarkerAttributesData: Compare.Order<markerAttributesData> =
...
@@ -183,6 +187,7 @@ export const byMarkerAttributesData: Compare.Order<markerAttributesData> =
descr
:
Compare
.
string
,
descr
:
Compare
.
string
,
isLval
:
Compare
.
boolean
,
isLval
:
Compare
.
boolean
,
isFunction
:
Compare
.
boolean
,
isFunction
:
Compare
.
boolean
,
isFunctionPointer
:
Compare
.
boolean
,
isFunDecl
:
Compare
.
boolean
,
isFunDecl
:
Compare
.
boolean
,
scope
:
Compare
.
defined
(
Compare
.
string
),
scope
:
Compare
.
defined
(
Compare
.
string
),
sloc
:
Compare
.
defined
(
bySource
),
sloc
:
Compare
.
defined
(
bySource
),
...
@@ -240,8 +245,8 @@ export const markerAttributes: State.Array<marker,markerAttributesData> = marker
...
@@ -240,8 +245,8 @@ export const markerAttributes: State.Array<marker,markerAttributesData> = marker
/** Default value for `markerAttributesData` */
/** Default value for `markerAttributesData` */
export
const
markerAttributesDataDefault
:
markerAttributesData
=
export
const
markerAttributesDataDefault
:
markerAttributesData
=
{
marker
:
markerDefault
,
labelKind
:
''
,
titleKind
:
''
,
name
:
''
,
descr
:
''
,
{
marker
:
markerDefault
,
labelKind
:
''
,
titleKind
:
''
,
name
:
''
,
descr
:
''
,
isLval
:
false
,
isFunction
:
false
,
isFun
Decl
:
false
,
scope
:
undefined
,
isLval
:
false
,
isFunction
:
false
,
isFun
ctionPointer
:
false
,
sloc
:
undefined
};
isFunDecl
:
false
,
scope
:
undefined
,
sloc
:
undefined
};
const
getMainFunction_internal
:
Server
.
GetRequest
<
null
,
fct
|
undefined
>
=
{
const
getMainFunction_internal
:
Server
.
GetRequest
<
null
,
fct
|
undefined
>
=
{
kind
:
Server
.
RqKind
.
GET
,
kind
:
Server
.
RqKind
.
GET
,
...
...
This diff is collapsed.
Click to expand it.
src/plugins/server/kernel_ast.ml
+
15
−
0
View file @
08af7e8d
...
@@ -320,6 +320,13 @@ struct
...
@@ -320,6 +320,13 @@ struct
|
Some
vi
->
Globals
.
Functions
.
mem
vi
|
Some
vi
->
Globals
.
Functions
.
mem
vi
|
None
->
false
|
None
->
false
let
is_function_pointer
=
function
|
PLval
(
_
,
_
,
(
Mem
_
,
NoOffset
as
lval
))
when
Cil
.(
isFunctionType
(
typeOfLval
lval
))
->
true
|
PLval
(
_
,
_
,
lval
)
when
Cil
.(
isFunPtrType
(
Cil
.
typeOfLval
lval
))
->
true
|
_
->
false
let
is_fundecl
=
function
let
is_fundecl
=
function
|
PVDecl
(
Some
_
,
Kglobal
,
vi
)
->
vi
.
vglob
&&
Globals
.
Functions
.
mem
vi
|
PVDecl
(
Some
_
,
Kglobal
,
vi
)
->
vi
.
vglob
&&
Globals
.
Functions
.
mem
vi
|
_
->
false
|
_
->
false
...
@@ -377,6 +384,14 @@ struct
...
@@ -377,6 +384,14 @@ struct
~
get
:
(
fun
(
tag
,
_
)
->
is_function
tag
)
~
get
:
(
fun
(
tag
,
_
)
->
is_function
tag
)
model
model
let
()
=
States
.
column
~
name
:
"isFunctionPointer"
~
descr
:
(
Md
.
plain
"Whether it is a function pointer"
)
~
data
:
(
module
Jbool
)
~
get
:
(
fun
(
tag
,
_
)
->
is_function_pointer
tag
)
model
let
()
=
let
()
=
States
.
column
States
.
column
~
name
:
"isFunDecl"
~
name
:
"isFunDecl"
...
...
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