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
61c96866
Commit
61c96866
authored
Oct 02, 2018
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move source highlighter out of debugger
parent
e3a5255f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
debugger.js
src/app/debugger/debugger.js
+6
-9
No files found.
src/app/debugger/debugger.js
View file @
61c96866
...
@@ -8,14 +8,13 @@ var globalRegistry = require('../../global/registry')
...
@@ -8,14 +8,13 @@ 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
()
this
.
sourceHighlighter
=
sourceHighlighter
this
.
registry
=
globalRegistry
this
.
registry
=
globalRegistry
this
.
offsetToLineColumnConverter
=
this
.
registry
.
get
(
'offsettolinecolumnconverter'
).
api
,
this
.
offsetToLineColumnConverter
=
this
.
registry
.
get
(
'offsettolinecolumnconverter'
).
api
this
.
editor
=
this
.
registry
.
get
(
'editor'
).
api
,
this
.
editor
=
this
.
registry
.
get
(
'editor'
).
api
this
.
compiler
=
this
.
registry
.
get
(
'compiler'
).
api
this
.
compiler
=
this
.
registry
.
get
(
'compiler'
).
api
this
.
debugger
=
new
Ethdebugger
(
this
.
debugger
=
new
Ethdebugger
(
...
@@ -63,7 +62,6 @@ function Debugger (sourceHighlighter) {
...
@@ -63,7 +62,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
])
})
})
...
@@ -78,19 +76,18 @@ function Debugger (sourceHighlighter) {
...
@@ -78,19 +76,18 @@ 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
.
compiler
.
lastCompilationResult
)
{
if
(
!
self
.
compiler
.
lastCompilationResult
)
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
.
compiler
.
lastCompilationResult
.
data
.
contracts
,
function
(
error
,
rawLocation
)
{
self
.
debugger
.
callTree
.
sourceLocationTracker
.
getSourceLocationFromVMTraceIndex
(
address
,
index
,
self
.
compiler
.
lastCompilationResult
.
data
.
contracts
,
function
(
error
,
rawLocation
)
{
if
(
!
error
&&
self
.
compiler
.
lastCompilationResult
&&
self
.
compiler
.
lastCompilationResult
.
data
)
{
if
(
!
error
&&
self
.
compiler
.
lastCompilationResult
&&
self
.
compiler
.
lastCompilationResult
.
data
)
{
var
lineColumnPos
=
self
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
rawLocation
,
rawLocation
.
file
,
self
.
compiler
.
lastCompilationResult
.
source
.
sources
)
var
lineColumnPos
=
self
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
rawLocation
,
rawLocation
.
file
,
self
.
compiler
.
lastCompilationResult
.
source
.
sources
)
self
.
sourceHighlighter
.
currentSourceLocation
(
lineColumnPos
,
rawLocation
)
self
.
event
.
trigger
(
'newSourceLocation'
,
[
lineColumnPos
,
rawLocation
]
)
}
else
{
}
else
{
self
.
sourceHighlighter
.
currentSourceLocation
(
null
)
self
.
event
.
trigger
(
'newSourceLocation'
,
[
null
]
)
}
}
})
})
})
})
}
}
}
module
.
exports
=
Debugger
module
.
exports
=
Debugger
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