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
a2600e1d
Commit
a2600e1d
authored
Mar 02, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keep a cache of source location
parent
f9b824dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
sourceLocationTracker.js
remix-lib/src/sourceLocationTracker.js
+10
-0
No files found.
remix-lib/src/sourceLocationTracker.js
View file @
a2600e1d
...
@@ -11,6 +11,8 @@ function SourceLocationTracker (_codeManager) {
...
@@ -11,6 +11,8 @@ function SourceLocationTracker (_codeManager) {
this
.
codeManager
=
_codeManager
this
.
codeManager
=
_codeManager
this
.
event
=
new
EventManager
()
this
.
event
=
new
EventManager
()
this
.
sourceMappingDecoder
=
new
SourceMappingDecoder
()
this
.
sourceMappingDecoder
=
new
SourceMappingDecoder
()
this
.
sourceMapCacheOfInstructionIndex
=
{}
this
.
sourceMapCacheOfVMTraceIndex
=
{}
}
}
/**
/**
...
@@ -23,10 +25,14 @@ function SourceLocationTracker (_codeManager) {
...
@@ -23,10 +25,14 @@ function SourceLocationTracker (_codeManager) {
*/
*/
SourceLocationTracker
.
prototype
.
getSourceLocationFromInstructionIndex
=
function
(
address
,
index
,
contracts
,
cb
)
{
SourceLocationTracker
.
prototype
.
getSourceLocationFromInstructionIndex
=
function
(
address
,
index
,
contracts
,
cb
)
{
var
self
=
this
var
self
=
this
if
(
self
.
sourceMapCacheOfInstructionIndex
[
address
])
{
return
cb
(
null
,
self
.
sourceMappingDecoder
.
atIndex
(
index
,
self
.
sourceMapCacheOfInstructionIndex
[
address
]))
}
extractSourceMap
(
this
.
codeManager
,
address
,
contracts
,
function
(
error
,
sourceMap
)
{
extractSourceMap
(
this
.
codeManager
,
address
,
contracts
,
function
(
error
,
sourceMap
)
{
if
(
error
)
{
if
(
error
)
{
cb
(
error
)
cb
(
error
)
}
else
{
}
else
{
if
(
!
helper
.
isContractCreation
(
address
))
self
.
sourceMapCacheOfInstructionIndex
[
address
]
=
sourceMap
cb
(
null
,
self
.
sourceMappingDecoder
.
atIndex
(
index
,
sourceMap
))
cb
(
null
,
self
.
sourceMappingDecoder
.
atIndex
(
index
,
sourceMap
))
}
}
})
})
...
@@ -42,12 +48,16 @@ SourceLocationTracker.prototype.getSourceLocationFromInstructionIndex = function
...
@@ -42,12 +48,16 @@ SourceLocationTracker.prototype.getSourceLocationFromInstructionIndex = function
*/
*/
SourceLocationTracker
.
prototype
.
getSourceLocationFromVMTraceIndex
=
function
(
address
,
vmtraceStepIndex
,
contracts
,
cb
)
{
SourceLocationTracker
.
prototype
.
getSourceLocationFromVMTraceIndex
=
function
(
address
,
vmtraceStepIndex
,
contracts
,
cb
)
{
var
self
=
this
var
self
=
this
if
(
self
.
sourceMapCacheOfVMTraceIndex
[
address
])
{
return
cb
(
null
,
self
.
sourceMappingDecoder
.
atIndex
(
vmtraceStepIndex
,
self
.
sourceMapCacheOfVMTraceIndex
[
address
]))
}
extractSourceMap
(
this
.
codeManager
,
address
,
contracts
,
function
(
error
,
sourceMap
)
{
extractSourceMap
(
this
.
codeManager
,
address
,
contracts
,
function
(
error
,
sourceMap
)
{
if
(
!
error
)
{
if
(
!
error
)
{
self
.
codeManager
.
getInstructionIndex
(
address
,
vmtraceStepIndex
,
function
(
error
,
index
)
{
self
.
codeManager
.
getInstructionIndex
(
address
,
vmtraceStepIndex
,
function
(
error
,
index
)
{
if
(
error
)
{
if
(
error
)
{
cb
(
error
)
cb
(
error
)
}
else
{
}
else
{
if
(
!
helper
.
isContractCreation
(
address
))
self
.
sourceMapCacheOfVMTraceIndex
[
address
]
=
sourceMap
cb
(
null
,
self
.
sourceMappingDecoder
.
atIndex
(
index
,
sourceMap
))
cb
(
null
,
self
.
sourceMappingDecoder
.
atIndex
(
index
,
sourceMap
))
}
}
})
})
...
...
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