forked from SkyLined/mBugId
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cFunction.py
21 lines (21 loc) · 898 Bytes
/
cFunction.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class cFunction(object):
def __init__(oFunction, oModule, sSymbol):
oFunction.oModule = oModule;
oFunction.sSymbol = sSymbol;
oFunction.sName = "%s!%s" % (oFunction.oModule.sBinaryName, oFunction.sSymbol);
# Replace complex template stuff with "<...>" to make a symbol easier to read.
asComponents = [""];
for sChar in oFunction.sSymbol:
if sChar == "<":
asComponents.append("");
elif sChar == ">":
if len(asComponents) == 1:
asComponents[-1] += ">"; # this is not closing a "<".
else:
sTemplate = asComponents.pop(); # discard contents of template
asComponents[-1] += "<...>";
else:
asComponents[-1] += sChar;
sSimpifiedSymbol = "<".join(asComponents);
oFunction.sSimplifiedName = "%s!%s" % (oFunction.oModule.sSimplifiedName, sSimpifiedSymbol);
oFunction.sUniqueName = sSymbol;