Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1055481a
Commit
1055481a
authored
Jun 24, 2001
by
Eric Pouech
Committed by
Alexandre Julliard
Jun 24, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed for new relay format. added thread knowledge.
parent
ea478c62
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
25 deletions
+38
-25
examine-relay
tools/examine-relay
+38
-25
No files found.
tools/examine-relay
View file @
1055481a
...
...
@@ -8,33 +8,39 @@
# list might be incorrect. (It could be something else also.)
#
# Copyright 1997-1998 Morten Welinder (terra@diku.dk)
# 2001 Eric Pouech
#
# -----------------------------------------------------------------------------
use
strict
;
my
$srcfile
=
$ARGV
[
0
];
my
@
callstack
=
();
my
%
tid_
callstack
=
();
my
$newlineerror
=
0
;
my
$indentp
=
1
;
open
(
IN
,
"<$srcfile"
)
||
die
"Cannot open $srcfile for reading: $!\n"
;
LINE:
while
(
<
IN
>
)
{
if
(
/^Call ([A-Za-z0-9]+\.\d+): .*\)/
)
{
my
$func
=
$1
;
if
(
/^([0-9a-f]+):Call ([A-Za-z0-9]+\.[A-Za-z0-9_]+)\((.*\)) .*/
)
{
my
$tid
=
$1
;
my
$func
=
$2
;
if
(
/ ret=(........)$/
||
/ ret=(....:....) (ds=....)$/
||
/ ret=(........) (fs=....)$/
)
{
/ ret=(....:....) (ds=....)$/
)
{
my
$retaddr
=
$1
;
my
$segreg
=
$2
;
$segreg
=
"none"
unless
defined
$segreg
;
push
@callstack
,
[
$func
,
$retaddr
,
$segreg
];
push
@
{
$tid_callstack
{
$tid
}},
[
$func
,
$retaddr
,
$segreg
];
next
;
}
else
{
# Assume a line got cut by a line feed in a string.
$_
.=
scalar
(
<
IN
>
);
if
(
!
$newlineerror
)
{
print
"Err
or:
string probably cut by newline.\n"
;
print
"Err
[$tid]
string probably cut by newline.\n"
;
$newlineerror
=
1
;
}
# print "[$_]";
...
...
@@ -42,29 +48,34 @@ while (<IN>) {
}
}
if
(
/^Ret ([A-Za-z0-9]+\.\d+): .* ret=(........)$/
||
/^Ret ([A-Za-z0-9]+\.\d+): .* ret=(....:....) (ds=....)$/
||
/^Ret ([A-Za-z0-9]+\.\d+): .* ret=(........) (fs=....)$/
)
{
my
$func
=
$1
;
my
$retaddr
=
$2
;
my
$segreg
=
$3
;
if
(
/^([0-9a-f]+):Ret ([A-Za-z0-9]+\.[A-Za-z0-9_]+)\(.*\) .* ret=(........)$/
||
/^([0-9a-f]+):Ret ([A-Za-z0-9]+\.[A-Za-z0-9_]+)\(.*\) .* ret=(....:....) (ds=....)$/
)
{
my
$tid
=
$1
;
my
$func
=
$2
;
my
$retaddr
=
$3
;
my
$segreg
=
$4
;
my
(
$topfunc
,
$topaddr
,
$topseg
);
if
(
!
defined
(
$tid_callstack
{
$tid
}))
{
print
"Err[$tid]: unknown tid\n"
;
next
;
}
$segreg
=
"none"
unless
defined
$segreg
;
POP:
while
(
1
)
{
if
(
$#
callstack
==
-
1
)
{
print
"Err
or
: Return from $func to $retaddr with empty stack.\n"
;
if
(
$#
{
$tid_callstack
{
$tid
}}
==
-
1
)
{
print
"Err
[$tid]
: Return from $func to $retaddr with empty stack.\n"
;
next
LINE
;
}
(
$topfunc
,
$topaddr
,
$topseg
)
=
@
{
pop
@
callstack
};
(
$topfunc
,
$topaddr
,
$topseg
)
=
@
{
pop
@
{
$tid_callstack
{
$tid
}}
};
if
(
$topfunc
ne
$func
)
{
print
"Err
or
: Return from $topfunc, but call from $func.\n"
;
next
POP
print
"Err
[$tid]
: Return from $topfunc, but call from $func.\n"
;
next
POP
;
}
last
POP
;
}
...
...
@@ -72,20 +83,22 @@ while (<IN>) {
my
$addrok
=
(
$topaddr
eq
$retaddr
);
my
$segok
=
(
$topseg
eq
$segreg
);
if
(
$addrok
&&
$segok
)
{
print
"O
K: "
,
(
$indentp
?
(
' '
x
(
1
+
$#callstack
))
:
''
);
print
"O
k [$tid]: "
,
(
$indentp
?
(
' '
x
(
1
+
$#
{
$tid_callstack
{
$tid
}}
))
:
''
);
print
"$func from $retaddr with $segreg.\n"
;
}
else
{
print
"Err
or
: Return from $func is to $retaddr, not $topaddr.\n"
print
"Err
[$tid]
: Return from $func is to $retaddr, not $topaddr.\n"
if
!
$addrok
;
print
"Err
or
: Return from $func with segreg $segreg, not $topseg.\n"
print
"Err
[$tid]
: Return from $func with segreg $segreg, not $topseg.\n"
if
!
$segok
;
}
}
}
while
(
$#callstack
!=
-
1
)
{
my
(
$topfunc
,
$topaddr
)
=
@
{
pop
@callstack
};
print
"Error: leftover call to $topfunc from $topaddr.\n"
;
foreach
my
$tid
(
keys
%
tid_callstack
)
{
while
(
$#
{
$tid_callstack
{
$tid
}}
!=
-
1
)
{
my
(
$topfunc
,
$topaddr
,
$topseg
)
=
@
{
pop
@
{
$tid_callstack
{
$tid
}}};
print
"Err[$tid]: leftover call to $topfunc from $topaddr.\n"
;
}
}
close
(
IN
);
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