-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
63 lines (55 loc) · 1.9 KB
/
index.html
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
51
52
53
54
55
56
57
58
59
60
61
62
63
<html>
<body>
</body>
<script type=module>
// Import Main Module
import { main, doRunParser, parseException, parseStackDump, explainException, identifyAddress } from './output/Main/index.js';
import * as StringParser_Parser from "./output/StringParser.Parser/index.js";
// For Testing: Export the PureScript Functions
window.main = main;
window.doRunParser = doRunParser;
window.StringParser_Parser = StringParser_Parser;
window.parseException = parseException;
window.parseStackDump = parseStackDump;
window.explainException = explainException;
window.identifyAddress = identifyAddress;
// Run parseException
console.log('Running parseException...');
const exception = `riscv_exception: EXCEPTION: Instruction page fault. MCAUSE: 000000000000000c, EPC: 000000008000ad8a, MTVAL: 000000008000ad8a`
const result1 = StringParser_Parser
.runParser
(parseException)
(exception)
;
console.log({result1});
window.result1 = result1;
// Run explainException
const result2 = explainException(12)('000000008000ad8a')('000000008000ad8a')
console.log({result2});
window.result2 = result2;
// Run parseStackDump
console.log('Running parseStackDump...');
const stackDump = `stack_dump: 0xc02027e0: c0202010 00000000 00000001 00000000 00000000 00000000 8000ad8a 00000000`;
const result3 = StringParser_Parser
.runParser
(parseStackDump)
(stackDump)
;
console.log({result3});
window.result3 = result3;
// Run identifyAddress
console.log('Running identifyAddress...');
const result4 = identifyAddress('502198ac')
console.log({result4});
window.result4 = result4;
const result5 = identifyAddress('80064a28')
console.log({result5});
window.result5 = result5;
const result6 = identifyAddress('0000000800203b88')
console.log({result6});
window.result6 = result6;
// Run Main Function
// console.log('Running main...');
// main();
</script>
</html>