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
ed177775
Commit
ed177775
authored
Feb 02, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
integrate breakpoint
parent
eef24405
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
debugger.js
src/app/debugger.js
+43
-0
No files found.
src/app/debugger.js
View file @
ed177775
...
@@ -11,6 +11,40 @@ function Debugger (id, appAPI, executionContextEvent, editorEvent) {
...
@@ -11,6 +11,40 @@ function Debugger (id, appAPI, executionContextEvent, editorEvent) {
this
.
sourceMappingDecoder
=
new
remix
.
util
.
SourceMappingDecoder
()
this
.
sourceMappingDecoder
=
new
remix
.
util
.
SourceMappingDecoder
()
this
.
el
.
appendChild
(
this
.
debugger
.
render
())
this
.
el
.
appendChild
(
this
.
debugger
.
render
())
this
.
appAPI
=
appAPI
this
.
appAPI
=
appAPI
this
.
markers
=
{}
this
.
breakPointManager
=
new
remix
.
code
.
BreakpointManager
(
this
.
debugger
)
this
.
debugger
.
setBreakpointManager
(
this
.
breakPointManager
)
this
.
breakPointManager
.
event
.
register
(
'breakpointHit'
,
(
sourceLocation
)
=>
{
this
.
editor
.
setBreakpoint
(
this
.
touchedBreakpoint
,
'breakpointUntouched'
)
var
lineColumnPos
=
this
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
sourceLocation
,
sourceLocation
.
file
,
this
.
editor
,
this
.
compiler
.
lastCompilationResult
.
data
)
this
.
editor
.
setBreakpoint
(
lineColumnPos
.
start
.
line
,
'breakpointTouched'
)
var
self
=
this
setTimeout
(
function
()
{
self
.
editor
.
setBreakpoint
(
lineColumnPos
.
start
.
line
,
'breakpointUntouched'
)
},
5000
)
})
function
convertSourceLocation
(
self
,
fileName
,
row
)
{
var
source
=
{}
for
(
let
file
in
self
.
compiler
.
lastCompilationResult
.
data
.
sourceList
)
{
if
(
self
.
compiler
.
lastCompilationResult
.
data
.
sourceList
[
file
]
===
fileName
)
{
source
.
file
=
file
break
}
}
source
.
start
=
self
.
offsetToLineColumnConverter
.
lineBreakPositionsByContent
[
source
.
file
][
row
>
0
?
row
-
1
:
0
]
source
.
end
=
self
.
offsetToLineColumnConverter
.
lineBreakPositionsByContent
[
source
.
file
][
row
]
source
.
row
=
row
return
source
}
editorEvent
.
register
(
'breakpointCleared'
,
(
fileName
,
row
)
=>
{
this
.
breakPointManager
.
remove
(
convertSourceLocation
(
this
,
fileName
,
row
))
})
editorEvent
.
register
(
'breakpointAdded'
,
(
fileName
,
row
)
=>
{
this
.
breakPointManager
.
add
(
convertSourceLocation
(
this
,
fileName
,
row
))
})
var
self
=
this
var
self
=
this
executionContextEvent
.
register
(
'contextChanged'
,
this
,
function
(
context
)
{
executionContextEvent
.
register
(
'contextChanged'
,
this
,
function
(
context
)
{
...
@@ -24,6 +58,7 @@ function Debugger (id, appAPI, executionContextEvent, editorEvent) {
...
@@ -24,6 +58,7 @@ function Debugger (id, appAPI, executionContextEvent, editorEvent) {
// unload if a file has changed (but not if tabs were switched)
// unload if a file has changed (but not if tabs were switched)
editorEvent
.
register
(
'contentChanged'
,
function
()
{
editorEvent
.
register
(
'contentChanged'
,
function
()
{
self
.
debugger
.
unLoad
()
self
.
debugger
.
unLoad
()
self
.
removeMarkers
()
})
})
// register selected code item, highlight the corresponding source location
// register selected code item, highlight the corresponding source location
...
@@ -56,6 +91,14 @@ Debugger.prototype.debug = function (txHash) {
...
@@ -56,6 +91,14 @@ Debugger.prototype.debug = function (txHash) {
})
})
}
}
Debugger
.
prototype
.
switchFile
=
function
(
rawLocation
)
{
var
name
=
this
.
editor
.
getCacheFile
()
// current opened tab
var
source
=
this
.
compiler
.
lastCompilationResult
.
data
.
sourceList
[
rawLocation
.
file
]
// auto switch to that tab
if
(
name
!==
source
)
{
this
.
switchToFile
(
source
)
// command the app to swicth to the next file
}
}
/**
/**
* add a new web3 provider to remix
* add a new web3 provider to remix
*
*
...
...
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