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
8bf8276a
Commit
8bf8276a
authored
Oct 10, 2018
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re-add offset component; add missing vmdebugger start
parent
4405f5d8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
24 deletions
+23
-24
debugger.js
remix-debug/src/debugger/debugger.js
+23
-24
No files found.
remix-debug/src/debugger/debugger.js
View file @
8bf8276a
...
@@ -3,6 +3,7 @@ var Ethdebugger = require('../Ethdebugger')
...
@@ -3,6 +3,7 @@ var Ethdebugger = require('../Ethdebugger')
var
remixLib
=
require
(
'remix-lib'
)
var
remixLib
=
require
(
'remix-lib'
)
var
EventManager
=
remixLib
.
EventManager
var
EventManager
=
remixLib
.
EventManager
var
traceHelper
=
remixLib
.
helpers
.
trace
var
traceHelper
=
remixLib
.
helpers
.
trace
var
OffsetToColumnConverter
=
remixLib
.
OffsetToColumnConverter
var
StepManager
=
require
(
'./stepManager'
)
var
StepManager
=
require
(
'./stepManager'
)
var
VmDebuggerLogic
=
require
(
'./VmDebugger'
)
var
VmDebuggerLogic
=
require
(
'./VmDebugger'
)
...
@@ -11,8 +12,7 @@ function Debugger (options) {
...
@@ -11,8 +12,7 @@ function Debugger (options) {
var
self
=
this
var
self
=
this
this
.
event
=
new
EventManager
()
this
.
event
=
new
EventManager
()
// TODO: temporarily commented out
this
.
offsetToLineColumnConverter
=
options
.
offsetToLineColumnConverter
||
(
new
OffsetToColumnConverter
())
// this.offsetToLineColumnConverter = options.offsetToLineColumnConverter
this
.
compiler
=
options
.
compiler
this
.
compiler
=
options
.
compiler
this
.
debugger
=
new
Ethdebugger
({
this
.
debugger
=
new
Ethdebugger
({
...
@@ -26,12 +26,11 @@ function Debugger (options) {
...
@@ -26,12 +26,11 @@ function Debugger (options) {
}
}
})
})
// TODO: temporarily commented out
this
.
breakPointManager
=
new
remixLib
.
code
.
BreakpointManager
(
this
.
debugger
,
(
sourceLocation
)
=>
{
// this.breakPointManager = new remixLib.code.BreakpointManager(this.debugger, (sourceLocation) => {
return
self
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
sourceLocation
,
sourceLocation
.
file
,
this
.
compiler
.
lastCompilationResult
.
source
.
sources
,
this
.
compiler
.
lastCompilationResult
.
data
.
sources
)
// return self.offsetToLineColumnConverter.offsetToLineColumn(sourceLocation, sourceLocation.file, this.compiler.lastCompilationResult.source.sources, this.compiler.lastCompilationResult.data.sources)
},
(
step
)
=>
{
// }, (step) => {
self
.
event
.
trigger
(
'breakpointStep'
,
[
step
])
// self.event.trigger('breakpointStep', [step])
})
// })
this
.
debugger
.
setBreakpointManager
(
this
.
breakPointManager
)
this
.
debugger
.
setBreakpointManager
(
this
.
breakPointManager
)
...
@@ -49,22 +48,20 @@ function Debugger (options) {
...
@@ -49,22 +48,20 @@ function Debugger (options) {
}
}
Debugger
.
prototype
.
registerAndHighlightCodeItem
=
function
(
index
)
{
Debugger
.
prototype
.
registerAndHighlightCodeItem
=
function
(
index
)
{
return
const
self
=
this
// TODO: temporarily commented out
// register selected code item, highlight the corresponding source location
// const self = this
if
(
!
self
.
compiler
.
lastCompilationResult
)
return
// // register selected code item, highlight the corresponding source location
self
.
debugger
.
traceManager
.
getCurrentCalledAddressAt
(
index
,
(
error
,
address
)
=>
{
// if (!self.compiler.lastCompilationResult) return
if
(
error
)
return
console
.
log
(
error
)
// self.debugger.traceManager.getCurrentCalledAddressAt(index, (error, address) => {
self
.
debugger
.
callTree
.
sourceLocationTracker
.
getSourceLocationFromVMTraceIndex
(
address
,
index
,
self
.
compiler
.
lastCompilationResult
.
data
.
contracts
,
function
(
error
,
rawLocation
)
{
// if (error) return console.log(error)
if
(
!
error
&&
self
.
compiler
.
lastCompilationResult
&&
self
.
compiler
.
lastCompilationResult
.
data
)
{
// self.debugger.callTree.sourceLocationTracker.getSourceLocationFromVMTraceIndex(address, index, self.compiler.lastCompilationResult.data.contracts, function (error, rawLocation) {
var
lineColumnPos
=
self
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
rawLocation
,
rawLocation
.
file
,
self
.
compiler
.
lastCompilationResult
.
source
.
sources
,
self
.
compiler
.
lastCompilationResult
.
data
.
sources
)
// if (!error && self.compiler.lastCompilationResult && self.compiler.lastCompilationResult.data) {
self
.
event
.
trigger
(
'newSourceLocation'
,
[
lineColumnPos
,
rawLocation
])
// var lineColumnPos = self.offsetToLineColumnConverter.offsetToLineColumn(rawLocation, rawLocation.file, self.compiler.lastCompilationResult.source.sources, self.compiler.lastCompilationResult.data.sources)
}
else
{
// self.event.trigger('newSourceLocation', [lineColumnPos, rawLocation])
self
.
event
.
trigger
(
'newSourceLocation'
,
[
null
])
// } else {
}
// self.event.trigger('newSourceLocation', [null])
})
// }
})
// })
// })
}
}
Debugger
.
prototype
.
updateWeb3
=
function
(
web3
)
{
Debugger
.
prototype
.
updateWeb3
=
function
(
web3
)
{
...
@@ -115,8 +112,10 @@ Debugger.prototype.debugTx = function (tx, loadingCb) {
...
@@ -115,8 +112,10 @@ Debugger.prototype.debugTx = function (tx, loadingCb) {
})
})
this
.
vmDebuggerLogic
=
new
VmDebuggerLogic
(
this
.
debugger
,
tx
,
this
.
step_manager
,
this
.
debugger
.
traceManager
,
this
.
debugger
.
codeManager
,
this
.
debugger
.
solidityProxy
,
this
.
debugger
.
callTree
)
this
.
vmDebuggerLogic
=
new
VmDebuggerLogic
(
this
.
debugger
,
tx
,
this
.
step_manager
,
this
.
debugger
.
traceManager
,
this
.
debugger
.
codeManager
,
this
.
debugger
.
solidityProxy
,
this
.
debugger
.
callTree
)
this
.
vmDebuggerLogic
.
start
()
this
.
step_manager
.
event
.
register
(
'stepChanged'
,
this
,
function
(
stepIndex
)
{
this
.
step_manager
.
event
.
register
(
'stepChanged'
,
this
,
function
(
stepIndex
)
{
console
.
dir
(
"stepChanged, going to trigger the other components.. "
+
stepIndex
);
self
.
debugger
.
codeManager
.
resolveStep
(
stepIndex
,
tx
)
self
.
debugger
.
codeManager
.
resolveStep
(
stepIndex
,
tx
)
self
.
step_manager
.
event
.
trigger
(
'indexChanged'
,
[
stepIndex
])
self
.
step_manager
.
event
.
trigger
(
'indexChanged'
,
[
stepIndex
])
self
.
vmDebuggerLogic
.
event
.
trigger
(
'indexChanged'
,
[
stepIndex
])
self
.
vmDebuggerLogic
.
event
.
trigger
(
'indexChanged'
,
[
stepIndex
])
...
...
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