summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2016-02-27 10:44:12 +0100
committerAndreas Gohr <andi@splitbrain.org>2016-02-27 10:44:12 +0100
commit545ab9c06a69c714e895582e20d5e06b02a8f128 (patch)
tree3e10ee875384f3e351fa2f34b1beb375f6efce6b
parentbf1e38abff698ecaa57bbea7e044539f56583c83 (diff)
downloadxdebug-trace-tree-545ab9c06a69c714e895582e20d5e06b02a8f128.zip
xdebug-trace-tree-545ab9c06a69c714e895582e20d5e06b02a8f128.tar.gz
xdebug-trace-tree-545ab9c06a69c714e895582e20d5e06b02a8f128.tar.bz2
added file:line and a way to mark lines important
-rw-r--r--index.php10
-rw-r--r--res/XDebugParser.php2
-rw-r--r--res/script.js21
-rw-r--r--res/style.css21
4 files changed, 47 insertions, 7 deletions
diff --git a/index.php b/index.php
index 71a39e0..c2dca4c 100644
--- a/index.php
+++ b/index.php
@@ -34,12 +34,16 @@
<li>click a function name to collapse all calls to the same function</li>
<li>click the parameter list to expand it</li>
<li>click the return list to expand it</li>
- <li>use the checkbox to hide all PHP internal functions</li>
+ <li>click the time to mark the line important</li>
+ <li>use checkboxes to hide all PHP internal functions or limit to important lines</li>
</ul>
<form class="options">
- <input type="checkbox" value="1" checked="checked" id="internal"><label for="internal">Show internal
- functions</label>
+ <input type="checkbox" value="1" checked="checked" id="internal">
+ <label for="internal">Show internal functions</label>
+
+ <input type="checkbox" value="1" id="marked">
+ <label for="marked">Show important only (slow)</label>
</form>
diff --git a/res/XDebugParser.php b/res/XDebugParser.php
index 3cf2616..acb5046 100644
--- a/res/XDebugParser.php
+++ b/res/XDebugParser.php
@@ -92,6 +92,7 @@ class XDebugParser
echo '<div class="f header">';
echo '<div class="func">Function Call</div>';
echo '<div class="data">';
+ echo '<span class="file">File:Line</span>';
echo '<span class="timediff">ΔTime</span>';
echo '<span class="memorydiff">ΔMemory</span>';
echo '<span class="time">Time</span>';
@@ -128,6 +129,7 @@ class XDebugParser
echo '</div>';
echo '<div class="data">';
+ echo '<span class="file" title="'.htmlspecialchars($func['file'].':'.$func['line']).'">'.htmlspecialchars(basename($func['file']).':'.$func['line']).'</span>';
echo '<span class="timediff">' . sprintf('%f', $func['time.diff']) . '</span>';
echo '<span class="memorydiff">' . sprintf('%d', $func['memory.diff']) . '</span>';
echo '<span class="time">' . sprintf('%f', $func['time.enter']) . '</span>';
diff --git a/res/script.js b/res/script.js
index f45ab90..0d01be1 100644
--- a/res/script.js
+++ b/res/script.js
@@ -1,6 +1,6 @@
$(function(){
-
+ /* hide blocks */
$('div.d, div.f').click(function (e) {
if (e.target !== this) return;
$(this).toggleClass('hide');
@@ -8,6 +8,7 @@ $(function(){
e.stopPropagation();
});
+ /* collapse parameters */
$('span.params, span.return').click(function (e) {
if (e.target !== this) return;
$(this).toggleClass('short');
@@ -15,10 +16,12 @@ $(function(){
e.stopPropagation();
});
+ /* hide internal funcs */
$('#internal').change(function(){
$('div.i').toggle();
});
+ /* hide functions */
$('span.name').click(function(e){
if (e.target !== this) return;
@@ -29,4 +32,20 @@ $(function(){
e.preventDefault();
e.stopPropagation();
});
+
+ /* mark important */
+ $('span.time').click(function(e){
+ if (e.target !== this) return;
+
+ $(this).closest('div.f').toggleClass('mark');
+
+ e.preventDefault();
+ e.stopPropagation();
+ });
+
+ /* hide internal funcs */
+ $('#marked').change(function(){
+ $('div.f').toggle();
+ $('div.f.mark').show();
+ });
}); \ No newline at end of file
diff --git a/res/style.css b/res/style.css
index 97844a1..8b6ea32 100644
--- a/res/style.css
+++ b/res/style.css
@@ -1,3 +1,7 @@
+label {
+ cursor: pointer;
+}
+
div.d {
padding-left: 2em;
border-left: 1px solid #ccc;
@@ -32,6 +36,10 @@ div.f.hide * {
display: none;
}
+div.f.mark {
+ background-color: #ffeced;
+}
+
div.f div {
padding: 5px 0;
@@ -43,9 +51,9 @@ div.f div.func {
div.f div.data {
flex-grow: 0;
- width: 450px;
- min-width: 450px;
- max-width: 450px;
+ width: 600px;
+ min-width: 600px;
+ max-width: 600px;
}
span {
@@ -57,6 +65,7 @@ span {
span.short {
max-height: 1.1em;
overflow: hidden;
+ word-break: break-all;
}
span.name {
@@ -74,14 +83,20 @@ span.return {
cursor: pointer;
}
+span.file,
span.time,
span.memorydiff,
span.timediff {
+ overflow: hidden;
width: 150px;
text-align: right;
white-space: nowrap;
}
+span.time {
+ cursor: pointer;
+}
+
div.header {
width: 100%;
font-weight: bold;