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
19038f22
Unverified
Commit
19038f22
authored
Mar 02, 2018
by
yann300
Committed by
GitHub
Mar 02, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #714 from ethereum/displaySourceLocationAnyCase
Display source location in any case
parents
f9b824dd
6df89948
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
sourceLocationTracker.js
remix-lib/src/sourceLocationTracker.js
+10
-0
internalCallTree.js
remix-solidity/src/decoder/internalCallTree.js
+1
-1
No files found.
remix-lib/src/sourceLocationTracker.js
View file @
19038f22
...
...
@@ -11,6 +11,8 @@ function SourceLocationTracker (_codeManager) {
this
.
codeManager
=
_codeManager
this
.
event
=
new
EventManager
()
this
.
sourceMappingDecoder
=
new
SourceMappingDecoder
()
this
.
sourceMapCacheOfInstructionIndex
=
{}
this
.
sourceMapCacheOfVMTraceIndex
=
{}
}
/**
...
...
@@ -23,10 +25,14 @@ function SourceLocationTracker (_codeManager) {
*/
SourceLocationTracker
.
prototype
.
getSourceLocationFromInstructionIndex
=
function
(
address
,
index
,
contracts
,
cb
)
{
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
)
{
if
(
error
)
{
cb
(
error
)
}
else
{
if
(
!
helper
.
isContractCreation
(
address
))
self
.
sourceMapCacheOfInstructionIndex
[
address
]
=
sourceMap
cb
(
null
,
self
.
sourceMappingDecoder
.
atIndex
(
index
,
sourceMap
))
}
})
...
...
@@ -42,12 +48,16 @@ SourceLocationTracker.prototype.getSourceLocationFromInstructionIndex = function
*/
SourceLocationTracker
.
prototype
.
getSourceLocationFromVMTraceIndex
=
function
(
address
,
vmtraceStepIndex
,
contracts
,
cb
)
{
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
)
{
if
(
!
error
)
{
self
.
codeManager
.
getInstructionIndex
(
address
,
vmtraceStepIndex
,
function
(
error
,
index
)
{
if
(
error
)
{
cb
(
error
)
}
else
{
if
(
!
helper
.
isContractCreation
(
address
))
self
.
sourceMapCacheOfVMTraceIndex
[
address
]
=
sourceMap
cb
(
null
,
self
.
sourceMappingDecoder
.
atIndex
(
index
,
sourceMap
))
}
})
...
...
remix-solidity/src/decoder/internalCallTree.js
View file @
19038f22
...
...
@@ -200,7 +200,7 @@ function includeVariableDeclaration (tree, step, sourceLocation, scopeId, newLoc
})
}
var
functionDefinition
=
resolveFunctionDefinition
(
tree
,
step
,
previousSourceLocation
)
if
(
functionDefinition
&&
((
newLocation
&&
traceHelper
.
isJumpDestInstruction
(
tree
.
traceManager
.
trace
[
step
-
1
]))
||
functionDefinition
.
attributes
.
isConstructor
))
{
if
(
functionDefinition
&&
newLocation
&&
traceHelper
.
isJumpDestInstruction
(
tree
.
traceManager
.
trace
[
step
-
1
]
))
{
tree
.
functionCallStack
.
push
(
step
)
// means: the previous location was a function definition && JUMPDEST
// => we are at the beginning of the function and input/output are setup
...
...
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