2f7cff7170
- Log the parameters to RPCs
- Display messages like stack frames
- handler function and script visible
- message preview instead of local variables
- Expanded and previewed messages do not collapse when stepping within the existing message
- Mark patch classes as finalized to avoid ASSERT on class_finalizer.cc:2358 **
- Support iterating over message queues
- Support printing the message queue as JSON
- Inhibit OOB messages from being handled if we are iterating over the message queue
- avoids dead lock when looking up port handler (done in Dart code with message handler locked) and a stack overflow trigger to handle OOB messages
- make getObject understand message ids
- Fix dartbug.com/23355
** Need to discuss with Ivan and Matthias (reviewed code differs from committed code but matches my fix):
https://codereview.chromium.org//828353002
https://code.google.com/p/dart/source/detail?r=42612
R=turnidge@google.com
Review URL: https://codereview.chromium.org//1122503003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45505 260f80e4-7a28-3924-810f-c04153c831b5
429 lines
13 KiB
HTML
429 lines
13 KiB
HTML
<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="eval_link.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="icon-chevron-right" noscript>
|
|
<template>
|
|
<svg width="24" height="24">
|
|
<path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/>
|
|
</svg>
|
|
</template>
|
|
</polymer-element>
|
|
|
|
<polymer-element name="icon-chevron-left" noscript>
|
|
<template>
|
|
<svg width="24" height="24">
|
|
<path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/>
|
|
</svg>
|
|
</template>
|
|
</polymer-element>
|
|
|
|
<polymer-element name="icon-horizontal-three-dot" noscript>
|
|
<template>
|
|
<svg width="24" height="24">
|
|
<path d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>
|
|
</svg>
|
|
</template>
|
|
</polymer-element>
|
|
|
|
<polymer-element name="icon-vertical-three-dot" noscript>
|
|
<template>
|
|
<svg width="24" height="24">
|
|
<path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>
|
|
</svg>
|
|
</template>
|
|
</polymer-element>
|
|
|
|
<polymer-element name="icon-info" noscript>
|
|
<template>
|
|
<svg width="24" height="24">
|
|
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/>
|
|
</svg>
|
|
</template>
|
|
</polymer-element>
|
|
|
|
<polymer-element name="icon-info-outline" noscript>
|
|
<template>
|
|
<svg width="24" height="24">
|
|
<path d="M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 9h2V7h-2v2z"/>
|
|
</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>
|
|
<vm-nav-menu vm="{{ isolate.vm }}"></vm-nav-menu>
|
|
<isolate-nav-menu isolate="{{ isolate }}"></isolate-nav-menu>
|
|
<nav-menu link="{{ makeLink('/debugger', isolate) }}" anchor="debugger" last="{{ true }}"></nav-menu>
|
|
</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;
|
|
}
|
|
.noMessages .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>
|
|
<hr>
|
|
<template if="{{ !hasMessages }}">
|
|
<div class="noMessages">No messages</div>
|
|
</template>
|
|
<ul id="messageList" class="list-group">
|
|
<!-- debugger-message 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);
|
|
}
|
|
.current {
|
|
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.26),
|
|
0 2px 5px 0 rgba(0, 0, 0, 0.46);
|
|
border: 1px solid #444;
|
|
}
|
|
.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'] }}"
|
|
inDebuggerContext="{{ true }}">
|
|
</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-message" extends="observatory-element">
|
|
<template>
|
|
<link rel="stylesheet" href="css/shared.css">
|
|
<style>
|
|
.messageOuter {
|
|
position: relative;
|
|
padding: 5px;
|
|
border: 1px solid white;
|
|
}
|
|
.messageOuter: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);
|
|
}
|
|
.current {
|
|
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.26),
|
|
0 2px 5px 0 rgba(0, 0, 0, 0.46);
|
|
border: 1px solid #444;
|
|
}
|
|
.messageSummaryText {
|
|
display: inline-block;
|
|
padding: 5px;
|
|
}
|
|
.messageId {
|
|
display: inline-block;
|
|
width: 100px;
|
|
}
|
|
.messageOuter .messageExpander {
|
|
position: absolute;
|
|
right: 5px;
|
|
top: 5px;
|
|
display: none;
|
|
}
|
|
.messageOuter:hover .messageExpander {
|
|
display: inline-block;
|
|
}
|
|
.messageContractor {
|
|
position: absolute;
|
|
right: 5px;
|
|
bottom: 5px;
|
|
display: inline-block;
|
|
}
|
|
</style>
|
|
<div id="messageOuter" class="messageOuter">
|
|
<a on-click="{{ toggleExpand }}">
|
|
<div class="messageSummary">
|
|
<div class="messageSummaryText">
|
|
<div class="messageId"><b>message {{ message['depth'] }}</b></div>
|
|
<function-ref ref="{{ message['handlerFunction'] }}"></function-ref>
|
|
( <script-ref ref="{{ message['handlerScript'] }}"
|
|
pos="{{ message['handlerTokenPos'] }}">
|
|
</script-ref> )
|
|
</div>
|
|
<template if="{{ !expanded }}">
|
|
<div class="messageExpander">
|
|
<icon-expand-more></icon-expand-more>
|
|
</div>
|
|
</template>
|
|
</div>
|
|
</a>
|
|
|
|
<template if="{{expanded}}">
|
|
<div class="messageDetails">
|
|
<div class="flex-row">
|
|
<div class="flex-item-60-percent">
|
|
<template if="{{ message['handlerFunction'] != null }}">
|
|
<script-inset height="{{ scriptHeight }}"
|
|
script="{{ message['handlerFunction'].script }}"
|
|
startPos="{{ message['handlerFunction'].tokenPos }}"
|
|
endPos="{{ message['handlerFunction'].endTokenPos }}"
|
|
inDebuggerContext="{{ true }}">
|
|
</script-inset>
|
|
</template>
|
|
</div>
|
|
<div class="flex-item-40-percent">
|
|
<div class="memberItem">
|
|
<div class="memberName"></div>
|
|
<div class="memberValue">
|
|
<eval-link callback="{{ previewMessage }}" label="[preview]" result="{{ preview }}"></eval-link>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="messageContractor">
|
|
<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;
|
|
white-space: pre;
|
|
line-height: 125%;
|
|
}
|
|
.bold {
|
|
font: bold 14px consolas, courier, monospace;
|
|
white-space: pre;
|
|
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>
|