diff --git a/html/crashview.html b/html/crashview.html new file mode 100644 index 0000000..6d977fa --- /dev/null +++ b/html/crashview.html @@ -0,0 +1,38 @@ + + + + + + Crashdump viewer & formatter + + + + +

Crashdump viewer & formatter

+

+Please paste a crashdump into the textarea below or select one from file. +

+ +
+ +

+ +

+
+ + + + + + diff --git a/html/crashview.js b/html/crashview.js new file mode 100644 index 0000000..d997f3a --- /dev/null +++ b/html/crashview.js @@ -0,0 +1,90 @@ +var lineRegEx = /(\d+)\s+(\S+)\s+(0x[0-9a-fA-F]+)\s+(.*)/; + +// Beautify the output by replacing overlong C++ symbol names by shorter aliases. +// NOTA BENE: Order of replacements matter! +var replaces = + [ + [ /std::__1::allocator/g , "ALLOC" ], + [ /std::__1::basic_string, ALLOC >/g, "STRING"], + [ /std::__1::vector >, ALLOC > > >/g, "JS::VALUE"], + [ //g , '>' ] + ]; + +function replaceAll(s) +{ + replaces.forEach(function(elem) + { + s = s.replace(elem[0], elem[1]); + } + ); + + return s; +} + +function addLogLine(nr, module, address, logline) +{ + document.getElementById('tbl').innerHTML += + '' + + nr + '' + + module + '' + + address + '' + + replaceAll(logline) + ''; +} + + +function parseData(stringData) +{ + var lines = stringData.split('\n'); + + for(var i=0; i'; + } + } +} + + +function handleFileSelect(evt) +{ + var files = evt.target.files; // FileList object + var file=files[0]; + + // files is a FileList of File objects. List some properties. + var output = []; + for (var i = 0, f; f = files[i]; i++) + { + output.push('

  • ', escape(f.name), ' (', f.type || 'n/a', ') - ', + f.size, ' bytes.
  • '); + } + + document.getElementById('list').innerHTML = ''; + document.getElementById('tbl').innerHTML = ''; + + var reader = new FileReader(); + reader.onload = function(progressEvent) + { + var stringData = reader.result; + parseData(stringData); + } + + reader.readAsText(file, "UTF-8"); +} + + +function handleDropzone() +{ + document.getElementById('tbl').innerHTML = ''; + parseData( document.getElementById("dropzone").value ); +}