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
2bc69fc2
Commit
2bc69fc2
authored
Oct 02, 2018
by
Iuri Matias
Committed by
yann300
Nov 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move source highlighter out of debugger
parent
c82501e9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
15 deletions
+23
-15
debugger.js
src/app/debugger/debugger.js
+14
-14
debuggerUI.js
src/app/debugger/debuggerUI.js
+9
-1
No files found.
src/app/debugger/debugger.js
View file @
2bc69fc2
...
@@ -8,7 +8,7 @@ var globalRegistry = require('../../global/registry')
...
@@ -8,7 +8,7 @@ var globalRegistry = require('../../global/registry')
/**
/**
* Manage remix and source highlighting
* Manage remix and source highlighting
*/
*/
function
Debugger
(
sourceHighlighter
)
{
function
Debugger
()
{
var
self
=
this
var
self
=
this
this
.
event
=
new
EventManager
()
this
.
event
=
new
EventManager
()
...
@@ -65,7 +65,6 @@ function Debugger (sourceHighlighter) {
...
@@ -65,7 +65,6 @@ function Debugger (sourceHighlighter) {
})
})
this
.
debugger
.
event
.
register
(
'traceUnloaded'
,
this
,
function
()
{
this
.
debugger
.
event
.
register
(
'traceUnloaded'
,
this
,
function
()
{
self
.
sourceHighlighter
.
currentSourceLocation
(
null
)
self
.
event
.
trigger
(
'debuggerStatus'
,
[
false
])
self
.
event
.
trigger
(
'debuggerStatus'
,
[
false
])
})
})
...
@@ -80,19 +79,20 @@ function Debugger (sourceHighlighter) {
...
@@ -80,19 +79,20 @@ function Debugger (sourceHighlighter) {
Debugger
.
prototype
.
registerAndHighlightCodeItem
=
function
(
index
)
{
Debugger
.
prototype
.
registerAndHighlightCodeItem
=
function
(
index
)
{
const
self
=
this
const
self
=
this
// register selected code item, highlight the corresponding source location
// register selected code item, highlight the corresponding source location
if
(
self
.
_deps
.
compiler
.
lastCompilationResult
)
{
if
(
!
self
.
_deps
.
compilersArtefacts
[
'__last'
])
return
self
.
debugger
.
traceManager
.
getCurrentCalledAddressAt
(
index
,
(
error
,
address
)
=>
{
self
.
debugger
.
traceManager
.
getCurrentCalledAddressAt
(
index
,
(
error
,
address
)
=>
{
if
(
error
)
return
console
.
log
(
error
)
if
(
error
)
return
console
.
log
(
error
)
self
.
debugger
.
callTree
.
sourceLocationTracker
.
getSourceLocationFromVMTraceIndex
(
address
,
index
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
.
contracts
,
function
(
error
,
rawLocation
)
{
var
compilerData
=
self
.
_deps
.
compilersArtefacts
[
'__last'
].
getdata
()
if
(
!
error
&&
self
.
_deps
.
compiler
.
lastCompilationResult
&&
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
)
{
if
(
!
compilerData
)
return
var
lineColumnPos
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
rawLocation
,
rawLocation
.
file
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
source
.
sources
)
self
.
debugger
.
callTree
.
sourceLocationTracker
.
getSourceLocationFromVMTraceIndex
(
address
,
index
,
compilerData
.
contracts
,
function
(
error
,
rawLocation
)
{
self
.
sourceHighlighter
.
currentSourceLocation
(
lineColumnPos
,
rawLocation
)
if
(
!
error
)
{
}
else
{
var
lineColumnPos
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
rawLocation
,
rawLocation
.
file
,
compilerData
.
source
.
sources
)
self
.
sourceHighlighter
.
currentSourceLocation
(
null
)
self
.
event
.
trigger
(
'newSourceLocation'
,
[
lineColumnPos
,
rawLocation
])
}
}
else
{
})
self
.
event
.
trigger
(
'newSourceLocation'
,
[
null
])
}
})
})
}
}
)
}
}
module
.
exports
=
Debugger
module
.
exports
=
Debugger
src/app/debugger/debuggerUI.js
View file @
2bc69fc2
...
@@ -31,7 +31,10 @@ class DebuggerUI {
...
@@ -31,7 +31,10 @@ class DebuggerUI {
constructor
(
container
)
{
constructor
(
container
)
{
const
self
=
this
const
self
=
this
this
.
transactionDebugger
=
new
Debugger
(
new
SourceHighlighter
())
this
.
sourceHighlighter
=
new
SourceHighlighter
()
this
.
transactionDebugger
=
new
Debugger
(
this
.
sourceHighlighter
)
this
.
debugger
=
this
.
transactionDebugger
.
debugger
this
.
debugger
=
this
.
transactionDebugger
.
debugger
this
.
isActive
=
false
this
.
isActive
=
false
this
.
event
=
new
EventManager
()
this
.
event
=
new
EventManager
()
...
@@ -62,6 +65,7 @@ class DebuggerUI {
...
@@ -62,6 +65,7 @@ class DebuggerUI {
listenToEvents
()
{
listenToEvents
()
{
const
self
=
this
const
self
=
this
this
.
transactionDebugger
.
event
.
register
(
'debuggerStatus'
,
function
(
isActive
)
{
this
.
transactionDebugger
.
event
.
register
(
'debuggerStatus'
,
function
(
isActive
)
{
self
.
sourceHighlighter
.
currentSourceLocation
(
null
)
self
.
isActive
=
isActive
self
.
isActive
=
isActive
})
})
...
@@ -72,6 +76,10 @@ class DebuggerUI {
...
@@ -72,6 +76,10 @@ class DebuggerUI {
this
.
event
.
register
(
'indexChanged'
,
function
(
index
)
{
this
.
event
.
register
(
'indexChanged'
,
function
(
index
)
{
self
.
transactionDebugger
.
registerAndHighlightCodeItem
(
index
)
self
.
transactionDebugger
.
registerAndHighlightCodeItem
(
index
)
})
})
this
.
event
.
register
(
'newSourceLocation'
,
function
(
lineColumnPos
,
rawLocation
)
{
self
.
sourceHighlighter
.
currentSourceLocation
(
lineColumnPos
,
rawLocation
)
})
}
}
startTxBrowser
()
{
startTxBrowser
()
{
...
...
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