diff --git a/htdocs/crashes.php b/htdocs/crashes.php index bb1da3e..b9f1d30 100644 --- a/htdocs/crashes.php +++ b/htdocs/crashes.php @@ -20,7 +20,7 @@ Layout::header(); Grid (region) - + id ?> client_channel . " " . $reports[$i]->client_version) ?> os) ?> diff --git a/htdocs/lib/CrashReport.php b/htdocs/lib/CrashReport.php index 3d07152..b9c3e43 100644 --- a/htdocs/lib/CrashReport.php +++ b/htdocs/lib/CrashReport.php @@ -22,6 +22,38 @@ class CrashReport public $threads = array(); public $raw_stacktrace; + function htmlFrame($f) + { + static $urlBase = "https://github.com/singularity-viewer/SingularityViewer/blob/master"; + + $ret = ""; + $link = ""; + if ($f->function) + { + $ret .= htmlentities($f->function); + if ($f->source_file) + { + if (false === $pos = strpos($f->source_file, "indra")) + { + $ret .= " " . $f->source_file; + } + else + { + $source = substr($f->source_file, $pos + 6); + $source = str_replace("\\", "/", $source); + $ret .= " at " . $source; + $ret .= " (line {$f->source_line} + {$f->function_offset})"; + $link = "$urlBase/indra/$source/#L{$f->source_line}"; + } + } + } + + if ($link) + { + $ret = '' . $ret . ''; + } + return $ret; + } function getTotal() { global $DB; @@ -57,6 +89,27 @@ class CrashReport return $ret; } + function getReport($id) + { + global $DB; + + $ret = array(); + if (!$res = $DB->query(kl_str_sql("select * from reports where id=!i", $id))) + { + return null; + } + + if ($row = $DB->fetchRow($res)) + { + $r = new CrashReport; + $DB->loadFromDbRow($r, $res, $row); + $r->parseStackTrace($r->raw_stacktrace); + return $r; + } + + return null; + } + function delete() { global $DB; diff --git a/htdocs/lib/DBH.php b/htdocs/lib/DBH.php index c1a4cfd..246d6b2 100644 --- a/htdocs/lib/DBH.php +++ b/htdocs/lib/DBH.php @@ -12,7 +12,7 @@ class DBH function log($line) { - return; + //return; static $f = false; static $failed = false; diff --git a/htdocs/report_detail.php b/htdocs/report_detail.php new file mode 100644 index 0000000..3490294 --- /dev/null +++ b/htdocs/report_detail.php @@ -0,0 +1,121 @@ +requireUser(); + +$report = CrashReport::getReport((int)$_GET["id"]); + +if (!$report) +{ + Layout::header(); + print "

Report Details

No such report

"; + Layout::footer(); + return; +} + + +Layout::header(); +?> + +

Report Details

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDid ?>
Reportedreported) ?>
Channelclient_channel) ?>
Versionclient_version) ?>
OS Typeos_type) ?>
OS Stringos) ?>
OS Versionos_version) ?>
Graphics Cardgpu) ?>
OpenGL Versionopengl_version) ?>
Gridgrid) ?>
Regionregion) ?>
Crash Reasoncrash_reason . " at " . $report->crash_address . " thread " . $report->crash_thread) ?>
+ +

Stack

+ +threads); $threadID++): ?> + + + + + + +threads[$threadID]->frames); $frameID++): $f = $report->threads[$threadID]->frames[$frameID]; ?> + + + + + + +
Thread crash_thread ? " (crashed)" : "")) ?>Function
module) ?>
+

+ + + +

Loaded Modules

+ + + + + +modules); $i++): ?> + + + + + +
NameVersion
modules[$i]->name) ?>modules[$i]->version) ?>
+ +