Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
7ac460aa
Commit
7ac460aa
authored
Nov 22, 2016
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use only compiler compilation result property + send compilation result to the debugger
parent
b4a512dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
debugger.js
src/app/debugger.js
+5
-9
No files found.
src/app/debugger.js
View file @
7ac460aa
...
@@ -23,11 +23,6 @@ function Debugger (id, editor, compiler, executionContextEvent, switchToFile, of
...
@@ -23,11 +23,6 @@ function Debugger (id, editor, compiler, executionContextEvent, switchToFile, of
self
.
switchProvider
(
context
)
self
.
switchProvider
(
context
)
})
})
this
.
lastCompilationResult
=
null
this
.
debugger
.
event
.
register
(
'newTraceLoaded'
,
this
,
function
()
{
self
.
lastCompilationResult
=
self
.
compiler
.
lastCompilationResult
})
this
.
debugger
.
event
.
register
(
'traceUnloaded'
,
this
,
function
()
{
this
.
debugger
.
event
.
register
(
'traceUnloaded'
,
this
,
function
()
{
self
.
removeCurrentMarker
()
self
.
removeCurrentMarker
()
})
})
...
@@ -40,10 +35,10 @@ function Debugger (id, editor, compiler, executionContextEvent, switchToFile, of
...
@@ -40,10 +35,10 @@ function Debugger (id, editor, compiler, executionContextEvent, switchToFile, of
// register selected code item, highlight the corresponding source location
// register selected code item, highlight the corresponding source location
this
.
debugger
.
codeManager
.
event
.
register
(
'changed'
,
this
,
function
(
code
,
address
,
index
)
{
this
.
debugger
.
codeManager
.
event
.
register
(
'changed'
,
this
,
function
(
code
,
address
,
index
)
{
if
(
self
.
lastCompilationResult
)
{
if
(
self
.
compiler
.
lastCompilationResult
)
{
this
.
debugger
.
sourceLocationTracker
.
getSourceLocation
(
address
,
index
,
self
.
lastCompilationResult
.
data
.
contracts
,
function
(
error
,
rawLocation
)
{
this
.
debugger
.
sourceLocationTracker
.
getSourceLocation
(
address
,
index
,
self
.
compiler
.
lastCompilationResult
.
data
.
contracts
,
function
(
error
,
rawLocation
)
{
if
(
!
error
)
{
if
(
!
error
)
{
var
lineColumnPos
=
self
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
rawLocation
,
rawLocation
.
file
,
self
.
editor
,
self
.
lastCompilationResult
.
data
)
var
lineColumnPos
=
self
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
rawLocation
,
rawLocation
.
file
,
self
.
editor
,
self
.
compiler
.
lastCompilationResult
.
data
)
self
.
highlight
(
lineColumnPos
,
rawLocation
)
self
.
highlight
(
lineColumnPos
,
rawLocation
)
}
else
{
}
else
{
self
.
removeCurrentMarker
()
self
.
removeCurrentMarker
()
...
@@ -62,6 +57,7 @@ Debugger.prototype.debug = function (txHash) {
...
@@ -62,6 +57,7 @@ Debugger.prototype.debug = function (txHash) {
var
self
=
this
var
self
=
this
this
.
debugger
.
web3
().
eth
.
getTransaction
(
txHash
,
function
(
error
,
tx
)
{
this
.
debugger
.
web3
().
eth
.
getTransaction
(
txHash
,
function
(
error
,
tx
)
{
if
(
!
error
)
{
if
(
!
error
)
{
self
.
debugger
.
setCompilationResult
(
self
.
compiler
.
lastCompilationResult
.
data
)
self
.
debugger
.
debug
(
tx
)
self
.
debugger
.
debug
(
tx
)
}
}
})
})
...
@@ -75,7 +71,7 @@ Debugger.prototype.debug = function (txHash) {
...
@@ -75,7 +71,7 @@ Debugger.prototype.debug = function (txHash) {
*/
*/
Debugger
.
prototype
.
highlight
=
function
(
lineColumnPos
,
rawLocation
)
{
Debugger
.
prototype
.
highlight
=
function
(
lineColumnPos
,
rawLocation
)
{
var
name
=
utils
.
fileNameFromKey
(
this
.
editor
.
getCacheFile
())
// current opened tab
var
name
=
utils
.
fileNameFromKey
(
this
.
editor
.
getCacheFile
())
// current opened tab
var
source
=
this
.
lastCompilationResult
.
data
.
sourceList
[
rawLocation
.
file
]
// auto switch to that tab
var
source
=
this
.
compiler
.
lastCompilationResult
.
data
.
sourceList
[
rawLocation
.
file
]
// auto switch to that tab
this
.
removeCurrentMarker
()
this
.
removeCurrentMarker
()
if
(
name
!==
source
)
{
if
(
name
!==
source
)
{
this
.
switchToFile
(
source
)
// command the app to swicth to the next file
this
.
switchToFile
(
source
)
// command the app to swicth to the next file
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment