summaryrefslogtreecommitdiff
path: root/tools/graphovl
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2023-03-14 20:51:47 -0300
committerGitHub <noreply@github.com>2023-03-15 10:51:47 +1100
commit0c3a48ef94a0c29253c5f1997f6fb79efeade261 (patch)
treee250b2b8210bd621c793b55fd77d1a60cc5b940a /tools/graphovl
parentc833969ea79ba31c3103e25e94ef88098c0287de (diff)
Subrepos update (#1208)
* git subrepo pull tools/asm-differ --force subrepo: subdir: "tools/asm-differ" merged: "ae408664a" upstream: origin: "https://github.com/simonlindholm/asm-differ" branch: "main" commit: "ae408664a" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull (merge) tools/fado --force subrepo: subdir: "tools/fado" merged: "8d896ee97" upstream: origin: "git@github.com:EllipticEllipsis/fado.git" branch: "master" commit: "8d896ee97" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/graphovl --force subrepo: subdir: "tools/graphovl" merged: "dab4addae" upstream: origin: "https://github.com/AngheloAlf/graphovl.git" branch: "master" commit: "dab4addae" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/z64compress --force subrepo: subdir: "tools/z64compress" merged: "43035d97f" upstream: origin: "https://github.com/z64me/z64compress.git" branch: "main" commit: "43035d97f" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/ZAPD --force subrepo: subdir: "tools/ZAPD" merged: "23929ec93" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "23929ec93" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * Revert "git subrepo pull tools/z64compress --force" This reverts commit 2e487b5008c129031ab311a3a7bfd42adeb4916b.
Diffstat (limited to 'tools/graphovl')
-rw-r--r--tools/graphovl/.gitrepo4
-rwxr-xr-xtools/graphovl/graphovl.py28
2 files changed, 26 insertions, 6 deletions
diff --git a/tools/graphovl/.gitrepo b/tools/graphovl/.gitrepo
index 064b8ee58..ca544b885 100644
--- a/tools/graphovl/.gitrepo
+++ b/tools/graphovl/.gitrepo
@@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/AngheloAlf/graphovl.git
branch = master
- commit = f5fe93d75bb75ea4bea65f62c43f41f6a1e70679
- parent = 6c5a50ef95f351acc7c4c0455a347a94443adbe1
+ commit = dab4addae0c5db6274ab5daf7780c62c346120a1
+ parent = 5da1ae553569ddb0016d302cfac8c45d9cb22e73
method = merge
cmdver = 0.4.3
diff --git a/tools/graphovl/graphovl.py b/tools/graphovl/graphovl.py
index 28f0a361c..7cb7af2c5 100755
--- a/tools/graphovl/graphovl.py
+++ b/tools/graphovl/graphovl.py
@@ -18,7 +18,7 @@ except ModuleNotFoundError:
script_dir = os.path.dirname(os.path.realpath(__file__))
config = ConfigParser()
-func_names = None
+func_names = list()
func_definitions = list()
line_numbers_of_functions = list()
@@ -72,6 +72,19 @@ def capture_setupaction_call_arg(content):
transitionList.append(func)
return transitionList
+setaction_regexpr = re.compile(r"_SetAction+\([^\)]*\)(\.[^\)]*\))?;")
+
+def capture_setaction_calls(content):
+ return [x.group() for x in re.finditer(setaction_regexpr, content)]
+
+def capture_setaction_call_arg(content):
+ transitionList = []
+ for x in re.finditer(setaction_regexpr, content):
+ func = x.group().split(",")[2].strip().split(");")[0].strip()
+ if func not in transitionList:
+ transitionList.append(func)
+ return transitionList
+
# Search for the function definition by supplied function name
def definition_by_name(content, name):
for definition in capture_definitions(content):
@@ -206,7 +219,11 @@ def addFunctionTransitionToGraph(dot, index: int, func_name: str, action_transit
fontColor = config.get("colors", "fontcolor")
bubbleColor = config.get("colors", "bubbleColor")
indexStr = str(index)
- funcIndex = str(index_of_func(action_transition))
+ try:
+ funcIndex = str(index_of_func(action_transition))
+ except ValueError:
+ print(f"Warning: function '{action_transition}' called by '{func_name}' was not found. Skiping...", file=sys.stderr)
+ return
dot.node(indexStr, func_name, fontcolor=fontColor, color=bubbleColor)
dot.node(funcIndex, action_transition, fontcolor=fontColor, color=bubbleColor)
@@ -230,7 +247,7 @@ def addCallNamesToGraph(dot, func_names: list, index: int, code_body: str, remov
if call in removeList:
continue
- if setupAction and "_SetupAction" in call:
+ if setupAction and ("_SetupAction" in call or "_SetAction" in call):
continue
seen.add(call)
@@ -342,10 +359,11 @@ def main():
actionIdentifier = "this->actionFunc"
setupAction = func_prefix + "_SetupAction" in func_names
+ setAction = func_prefix + "_SetAction" in func_names
arrayActorFunc = match_obj is not None
rawActorFunc = actionIdentifier in contents
- if not setupAction and not arrayActorFunc and not rawActorFunc:
+ if not setupAction and not setAction and not arrayActorFunc and not rawActorFunc:
print("No actor action-based structure found")
os._exit(1)
@@ -383,6 +401,8 @@ def main():
Create all edges for SetupAction-based actors
"""
transitionList = capture_setupaction_call_arg(code_body)
+ elif setAction:
+ transitionList = capture_setaction_call_arg(code_body)
elif arrayActorFunc:
"""
Create all edges for ActorFunc array-based actors