Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Caren Kresse
callgraph
Commits
4878ccea
Commit
4878ccea
authored
Oct 01, 2021
by
Carsten Emde
Browse files
Graphviz (the dot program) does not accept dots in digraph name, now
replaced by dashes. Optimized target search loop a bit
parent
f75a5e56
Changes
1
Hide whitespace changes
Inline
Side-by-side
generatecypher.py
View file @
4878ccea
...
...
@@ -92,29 +92,28 @@ def createoutput(outputdir, outputformat, machine_to_binary, linked_libraries,
for
o
in
machine_to_binary
[
architecture
]:
for
endian
in
machine_to_binary
[
architecture
][
o
]:
for
elfclass
in
machine_to_binary
[
architecture
][
o
][
endian
]:
for
filename
in
machine_to_binary
[
architecture
][
o
][
endian
][
elfclass
]:
if
filename
==
target
:
if
target_architecture
==
''
:
target_architecture
=
architecture
else
:
if
architecture
!=
target_architecture
:
print
(
"Info: Architecture of target %s (%s) is different from architecture of first target (%s)"
%
(
target
,
architecture
,
target_architecture
))
if
target_machine
==
''
:
target_machine
=
o
else
:
if
o
!=
target_machine
:
print
(
"Info: Machine of target %s (%s) is different from machine of first target (%s)"
%
(
target
,
o
,
target_machine
))
if
target_endian
==
''
:
target_endian
=
endian
else
:
if
endian
!=
target_endian
:
print
(
"Info: Endian of target %s (%s) is different from endian of first target (%s)"
%
(
target
,
endian
,
target_endian
))
if
target_elfclass
==
''
:
target_elfclass
=
elfclass
else
:
if
elfclass
!=
target_elfclass
:
print
(
"Info: Elfclass of target %s (%s) is different from elfclass of first target (%s)"
%
(
target
,
elfclass
,
target_elfclass
))
raise
StopIteration
if
target
in
machine_to_binary
[
architecture
][
o
][
endian
][
elfclass
]:
if
target_architecture
==
''
:
target_architecture
=
architecture
else
:
if
architecture
!=
target_architecture
:
print
(
"Info: Architecture of target %s (%s) is different from architecture of first target (%s)"
%
(
target
,
architecture
,
target_architecture
))
if
target_machine
==
''
:
target_machine
=
o
else
:
if
o
!=
target_machine
:
print
(
"Info: Machine of target %s (%s) is different from machine of first target (%s)"
%
(
target
,
o
,
target_machine
))
if
target_endian
==
''
:
target_endian
=
endian
else
:
if
endian
!=
target_endian
:
print
(
"Info: Endian of target %s (%s) is different from endian of first target (%s)"
%
(
target
,
endian
,
target_endian
))
if
target_elfclass
==
''
:
target_elfclass
=
elfclass
else
:
if
elfclass
!=
target_elfclass
:
print
(
"Info: Elfclass of target %s (%s) is different from elfclass of first target (%s)"
%
(
target
,
elfclass
,
target_elfclass
))
raise
StopIteration
except
StopIteration
:
pass
...
...
@@ -205,7 +204,7 @@ def createoutput(outputdir, outputformat, machine_to_binary, linked_libraries,
outputfileopen
.
write
(
"<graph defaultedgetype=
\"
directed
\"
idtype=
\"
string
\"
type=
\"
static
\"
>
\n
"
)
outputfileopen
.
write
(
"<nodes>
\n
"
)
elif
outputformat
==
'gv'
:
outputfileopen
.
write
(
"digraph "
+
os
.
path
.
basename
(
limitsearch
[
0
])
+
" {
\n
ratio=0.562;
\n
"
)
outputfileopen
.
write
(
"digraph "
+
os
.
path
.
basename
(
limitsearch
[
0
])
.
replace
(
'.'
,
'-'
)
+
" {
\n
ratio=0.562;
\n
"
)
if
fontname
is
not
None
:
outputfileopen
.
write
(
" graph [fontname=
\"
"
+
fontname
+
"
\"
];
\n
"
)
outputfileopen
.
write
(
" node [fontname=
\"
"
+
fontname
+
"
\"
];
\n
"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment