forked from SkyLined/mBugId
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cBugReport_CdbTerminatedUnexpectedly.py
50 lines (46 loc) · 2.13 KB
/
cBugReport_CdbTerminatedUnexpectedly.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from sBlockHTMLTemplate import sBlockHTMLTemplate;
from sReportHTMLTemplate import sReportHTMLTemplate;
from sVersion import sVersion;
class cBugReport_CdbTerminatedUnexpectedly(object):
def __init__(oBugReport, oCdbWrapper, uExitCode):
if uExitCode < 0:
uExitCode += 1 << 32;
oBugReport.sBugTypeId = "CdbTerminated:0x%X" % uExitCode;
oBugReport.sBugDescription = "Cdb terminated unexpectedly";
oBugReport.sBugLocation = None;
oBugReport.sSecurityImpact = None;
oBugReport.oException = None;
oBugReport.oStack = None;
if oCdbWrapper.bGenerateReportHTML:
oBugReport.sImportantOutputHTML = oCdbWrapper.sImportantOutputHTML;
oBugReport.sProcessBinaryName = "cdb.exe";
oBugReport.sId = oBugReport.sBugTypeId;
oBugReport.sStackId = None;
oBugReport.sBugLocation = None;
oBugReport.sBugSourceLocation = None;
oBugReport.asVersionInformation = ["BugId: %s" % sVersion];
if oCdbWrapper.bGenerateReportHTML:
# Turn cdb output into formatted HTML. It is separated into blocks, one for the initial cdb output and one for each
# command executed.
sCdbStdIOHTML = '<hr/>'.join(oCdbWrapper.asCdbStdIOBlocksHTML);
asBlocksHTML = [];
asBlocksHTML.append(sBlockHTMLTemplate % {
"sName": "Application and cdb output log",
"sCollapsed": "Collapsed",
"sContent": sCdbStdIOHTML
});
del oCdbWrapper.asCdbStdIOBlocksHTML;
# Create HTML details
oBugReport.sReportHTML = sReportHTMLTemplate % {
"sId": oCdbWrapper.fsHTMLEncode(oBugReport.sId),
"sBugLocation": oCdbWrapper.fsHTMLEncode(oBugReport.sBugLocation or "Unknown"),
"sBugDescription": oCdbWrapper.fsHTMLEncode(oBugReport.sBugDescription),
"sBinaryVersion": "Not available",
"sOptionalSource": "",
"sSecurityImpact": oBugReport.sSecurityImpact and \
'<span class="SecurityImpact">%s</span>' % oCdbWrapper.fsHTMLEncode(oBugReport.sSecurityImpact) or "None",
"sOptionalCommandLine": "",
"sBugIdVersion": sVersion,
"sBlocks": "\r\n".join(asBlocksHTML),
"sCdbStdIO": sCdbStdIOHTML,
};