blob: 997ff7739c378adb018069c904f0c449ce64af82 [file] [log] [blame]
<link rel="import" href="../../../../packages/polymer/polymer.html">
<link rel="import" href="function_ref.html">
<link rel="import" href="nav_bar.html">
<link rel="import" href="observatory_element.html">
<link rel="import" href="script_inset.html">
<link rel="import" href="script_ref.html">
<!-- TODO(turnidge): Use core-icon once core_elements work properly in
devtools -->
<polymer-element name="icon-expand-less" noscript>
<template>
<svg width="24" height="24">
<polygon points="12,8 6,14 7.4,15.4 12,10.8 16.6,15.4 18,14 "/>
</svg>
</template>
</polymer-element>
<polymer-element name="icon-expand-more" noscript>
<template>
<svg width="24" height="24">
<polygon points="16.6,8.6 12,13.2 7.4,8.6 6,10 12,16 18,10 "/>
</svg>
</template>
</polymer-element>
<polymer-element name="debugger-page" extends="observatory-element">
<template>
<link rel="stylesheet" href="css/shared.css">
<style>
.container {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
nav-bar {
flex: 0 0 auto;
}
.stack {
flex: 0 0 auto;
overflow-y: auto;
}
.splitter {
height: 0px;
margin: 0px;
font-size: 1px;
border-bottom: 1px solid #888;
}
core-splitter {
flex: 0 0 auto;
}
.console {
flex: 1 1 auto;
overflow-y: auto;
}
.commandline {
flex: 0 0 auto;
}
</style>
<div class="container">
<nav-bar id="navbarDiv" showNotify="{{ false }}">
<top-nav-menu></top-nav-menu>
<isolate-nav-menu isolate="{{ isolate }}">
</isolate-nav-menu>
<nav-menu link="{{ makeLink('/debugger', isolate) }}" anchor="debugger" last="{{ true }}"></nav-menu>
<nav-control></nav-control>
</nav-bar>
<div id="stackDiv" class="stack">
<debugger-stack id="stackElement" isolate="{{ isolate }}"></debugger-stack>
</div>
<!--
<core-splitter direction="up" allowOverflow=true></core-splitter>
-->
<div id="splitterDiv"><hr class="splitter"></div>
<div id="consoleDiv" class="console">
<debugger-console id="console" isolate="{{ isolate }}"></debugger-console>
</div>
<div id="commandDiv" class="commandline">
<debugger-input id="commandline" isolate="{{ isolate }}"></debugger-input>
</div>
</div>
</template>
</polymer-element>
<polymer-element name="debugger-stack" extends="observatory-element">
<template>
<link rel="stylesheet" href="css/shared.css">
<style>
.sampledMessage {
margin: 0px 20px 10px 20px;
font: 400 14px 'Montserrat', sans-serif;
line-height: 125%;
}
.splitter {
height: 0px;
margin: 0px;
font-size: 1px;
border-bottom: 1px dashed #888;
}
.noStack {
margin: 0px 20px 10px 20px;
font: normal 14px consolas, courier, monospace;
line-height: 125%;
}
</style>
<template if="{{ isSampled }}">
<div class="sampledMessage">
The program is not paused. The stack trace below may be out of date.<br>
<br>
<action-link label="Pause Isolate" callback="{{ doPauseIsolate }}">
</action-link>
<action-link label="Refresh Stack" callback="{{ doRefreshStack }}">
</action-link>
<br>
<br>
<hr class="splitter">
</div>
</template>
<template if="{{ !hasStack }}">
<div class="noStack">No stack</div>
</template>
<ul id="frameList" class="list-group">
<!-- debugger-frame elements are added programmatically -->
</ul>
</template>
</polymer-element>
<polymer-element name="debugger-frame" extends="observatory-element">
<template>
<link rel="stylesheet" href="css/shared.css">
<style>
.frameOuter {
position: relative;
padding: 5px;
border: 1px solid white;
}
.frameOuter:hover {
border: 1px solid #e0e0e0;
}
.shadow {
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.16),
0 2px 5px 0 rgba(0, 0, 0, 0.26);
}
.frameSummaryText {
display: inline-block;
padding: 5px;
}
.frameId {
display: inline-block;
width: 60px;
}
.frameOuter .frameExpander {
position: absolute;
right: 5px;
top: 5px;
display: none;
}
.frameOuter:hover .frameExpander{
display: inline-block;
}
.frameContractor {
position: absolute;
right: 5px;
bottom: 5px;
display: inline-block;
}
</style>
<div id="frameOuter" class="frameOuter">
<a on-click="{{ toggleExpand }}">
<div class="frameSummary">
<div class="frameSummaryText">
<div class="frameId"><b>frame {{ frame['depth'] }}</b></div>
<function-ref ref="{{ frame['function'] }}"></function-ref>
( <script-ref ref="{{ frame['script'] }}"
pos="{{ frame['tokenPos'] }}">
</script-ref> )
</div>
<template if="{{ !expanded }}">
<div class="frameExpander">
<icon-expand-more></icon-expand-more>
</div>
</template>
</div>
</a>
<template if="{{expanded}}">
<div class="frameDetails">
<div class="flex-row">
<div class="flex-item-60-percent">
<script-inset height="{{ scriptHeight }}"
script="{{ frame['function'].script }}"
startPos="{{ frame['function'].tokenPos }}"
endPos="{{ frame['function'].endTokenPos }}"
currentPos="{{ frame['tokenPos'] }}">
</script-inset>
</div>
<div class="flex-item-40-percent">
<div style="padding:10px;" class="memberList">
<template repeat="{{ v in frame['vars'] }}">
<div class="memberItem">
<div class="memberName">{{ v['name']}}</div>
<div class="memberValue">
<any-service-ref ref="{{ v['value'] }}">
</any-service-ref>
</div>
</div>
</template>
</div>
</div>
</div>
<!-- TODO(turnidge): Add eval box here? -->
<div class="frameContractor">
<template if="{{expanded}}">
<a on-click="{{ toggleExpand }}">
<icon-expand-less></icon-expand-less>
</a>
</template>
</div>
</div>
</template>
</div>
</template>
</polymer-element>
<polymer-element name="debugger-console" extends="observatory-element">
<template>
<link rel="stylesheet" href="css/shared.css">
<style>
.console {
margin: 0px 20px 10px 20px;
}
.normal {
font: normal 14px consolas, courier, monospace;
line-height: 125%;
}
.bold {
font: bold 14px consolas, courier, monospace;
line-height: 125%;
}
.spacer {
height: 20px;
}
</style>
<div id="consoleText" class="console">
<!-- Console output is added programmatically here using the 'normal'
and 'bold' styles. -->
</div>
</template>
</polymer-element>
<polymer-element name="debugger-input" extends="observatory-element">
<template>
<link rel="stylesheet" href="css/shared.css">
<style>
.textBox {
margin: 20px;
font: 400 16px consolas, courier, monospace;
width: 95%;
}
</style>
<input id="textBox" class="textBox" type="text" value="{{ text }}" autofocus>
</template>
</polymer-element>
<script type="application/dart" src="debugger.dart"></script>