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
3ef2e631
Commit
3ef2e631
authored
Nov 14, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix debugging with source location
parent
4afd5e6f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
9 deletions
+16
-9
debugger.js
src/app/debugger/debugger/debugger.js
+14
-7
debuggerUI.js
src/app/debugger/debuggerUI.js
+2
-1
debugger-tab.js
src/app/tabs/debugger-tab.js
+0
-1
No files found.
src/app/debugger/debugger/debugger.js
View file @
3ef2e631
...
@@ -12,20 +12,23 @@ function Debugger (options) {
...
@@ -12,20 +12,23 @@ function Debugger (options) {
this
.
event
=
new
EventManager
()
this
.
event
=
new
EventManager
()
this
.
executionContext
=
options
.
executionContext
this
.
executionContext
=
options
.
executionContext
// dependencies
this
.
offsetToLineColumnConverter
=
options
.
offsetToLineColumnConverter
this
.
offsetToLineColumnConverter
=
options
.
offsetToLineColumnConverter
this
.
compiler
=
options
.
compiler
this
.
compilersArtefacts
=
options
.
compilersArtefacts
this
.
compilerArtefacts
=
options
.
compilersArtefacts
this
.
debugger
=
new
Ethdebugger
({
this
.
debugger
=
new
Ethdebugger
({
executionContext
:
options
.
executionContext
,
executionContext
:
options
.
executionContext
,
compilationResult
:
()
=>
{
compilationResult
:
()
=>
{
if
(
this
.
options
.
compilersArtefacts
[
'__last'
])
return
this
.
option
s
.
compilersArtefacts
[
'__last'
].
getData
()
if
(
this
.
compilersArtefacts
[
'__last'
])
return
thi
s
.
compilersArtefacts
[
'__last'
].
getData
()
return
null
return
null
}
}
})
})
this
.
breakPointManager
=
new
remixLib
.
code
.
BreakpointManager
(
this
.
debugger
,
(
sourceLocation
)
=>
{
this
.
breakPointManager
=
new
remixLib
.
code
.
BreakpointManager
(
this
.
debugger
,
(
sourceLocation
)
=>
{
return
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
sourceLocation
,
sourceLocation
.
file
,
this
.
_deps
.
compiler
.
lastCompilationResult
.
source
.
sources
,
this
.
_deps
.
compiler
.
lastCompilationResult
.
data
.
sources
)
if
(
!
this
.
compilersArtefacts
[
'__last'
])
return
null
let
compilationData
=
this
.
compilersArtefacts
[
'__last'
].
getData
()
if
(
!
compilationData
)
return
null
return
self
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
sourceLocation
,
sourceLocation
.
file
,
compilationData
.
sources
,
compilationData
.
sources
)
},
(
step
)
=>
{
},
(
step
)
=>
{
self
.
event
.
trigger
(
'breakpointStep'
,
[
step
])
self
.
event
.
trigger
(
'breakpointStep'
,
[
step
])
})
})
...
@@ -57,12 +60,16 @@ function Debugger (options) {
...
@@ -57,12 +60,16 @@ function Debugger (options) {
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
.
compilersArtefacts
[
'__last'
])
return
if
(
!
self
.
compilersArtefacts
[
'__last'
])
{
self
.
event
.
trigger
(
'newSourceLocation'
,
[
null
])
return
}
var
compilerData
=
self
.
compilersArtefacts
[
'__last'
].
getData
()
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
.
d
ata
.
contracts
,
function
(
error
,
rawLocation
)
{
self
.
debugger
.
callTree
.
sourceLocationTracker
.
getSourceLocationFromVMTraceIndex
(
address
,
index
,
compilerD
ata
.
contracts
,
function
(
error
,
rawLocation
)
{
if
(
!
error
)
{
if
(
!
error
)
{
var
lineColumnPos
=
self
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
rawLocation
,
rawLocation
.
file
,
compilerData
.
source
.
sources
,
compilerData
.
d
ata
.
sources
)
var
lineColumnPos
=
self
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
rawLocation
,
rawLocation
.
file
,
compilerData
.
source
s
,
compilerD
ata
.
sources
)
self
.
event
.
trigger
(
'newSourceLocation'
,
[
lineColumnPos
,
rawLocation
])
self
.
event
.
trigger
(
'newSourceLocation'
,
[
lineColumnPos
,
rawLocation
])
}
else
{
}
else
{
self
.
event
.
trigger
(
'newSourceLocation'
,
[
null
])
self
.
event
.
trigger
(
'newSourceLocation'
,
[
null
])
...
...
src/app/debugger/debuggerUI.js
View file @
3ef2e631
...
@@ -34,7 +34,8 @@ class DebuggerUI {
...
@@ -34,7 +34,8 @@ class DebuggerUI {
this
.
debugger
=
new
Debugger
({
this
.
debugger
=
new
Debugger
({
executionContext
:
executionContext
,
executionContext
:
executionContext
,
offsetToLineColumnConverter
:
this
.
registry
.
get
(
'offsettolinecolumnconverter'
).
api
,
offsetToLineColumnConverter
:
this
.
registry
.
get
(
'offsettolinecolumnconverter'
).
api
,
compiler
:
this
.
registry
.
get
(
'compiler'
).
api
compiler
:
this
.
registry
.
get
(
'compiler'
).
api
,
compilersArtefacts
:
this
.
registry
.
get
(
'compilersartefacts'
).
api
})
})
this
.
isActive
=
false
this
.
isActive
=
false
...
...
src/app/tabs/debugger-tab.js
View file @
3ef2e631
...
@@ -25,7 +25,6 @@ class DebuggerTab {
...
@@ -25,7 +25,6 @@ class DebuggerTab {
self
.
_view
=
{
el
:
null
}
self
.
_view
=
{
el
:
null
}
self
.
data
=
{}
self
.
data
=
{}
self
.
_components
=
{}
self
.
_components
=
{}
// TODO: what is this used for? is repated in debugger.js
self
.
_components
.
registry
=
localRegistry
||
globalRegistry
self
.
_components
.
registry
=
localRegistry
||
globalRegistry
}
}
...
...
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