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
6a1512f9
Commit
6a1512f9
authored
Jul 02, 2021
by
filip mertens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix debugger crash
parent
941d0b63
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
54 deletions
+62
-54
solidity-state.tsx
...mix-ui/debugger-ui/src/lib/vm-debugger/solidity-state.tsx
+25
-21
solidityTypeFormatter.ts
libs/remix-ui/debugger-ui/src/utils/solidityTypeFormatter.ts
+37
-33
No files found.
libs/remix-ui/debugger-ui/src/lib/vm-debugger/solidity-state.tsx
View file @
6a1512f9
...
@@ -5,32 +5,36 @@ import { ExtractData } from '../../types' // eslint-disable-line
...
@@ -5,32 +5,36 @@ import { ExtractData } from '../../types' // eslint-disable-line
export
const
SolidityState
=
({
calldata
,
message
})
=>
{
export
const
SolidityState
=
({
calldata
,
message
})
=>
{
const
formatSelf
=
(
key
:
string
,
data
:
ExtractData
)
=>
{
const
formatSelf
=
(
key
:
string
,
data
:
ExtractData
)
=>
{
let
color
=
'var(--primary)'
try
{
if
(
data
.
isArray
||
data
.
isStruct
||
data
.
isMapping
)
{
let
color
=
'var(--primary)'
color
=
'var(--info)'
if
(
data
.
isArray
||
data
.
isStruct
||
data
.
isMapping
)
{
}
else
if
(
color
=
'var(--info)'
data
.
type
.
indexOf
(
'uint'
)
===
0
||
}
else
if
(
data
.
type
.
indexOf
(
'uint'
)
===
0
||
data
.
type
.
indexOf
(
'int'
)
===
0
||
data
.
type
.
indexOf
(
'int'
)
===
0
||
data
.
type
.
indexOf
(
'bool'
)
===
0
||
data
.
type
.
indexOf
(
'bool'
)
===
0
||
data
.
type
.
indexOf
(
'enum'
)
===
0
data
.
type
.
indexOf
(
'enum'
)
===
0
)
{
)
{
color
=
'var(--green)'
color
=
'var(--green)'
}
else
if
(
data
.
type
===
'string'
)
{
}
else
if
(
data
.
type
===
'string'
)
{
color
=
'var(--teal)'
color
=
'var(--teal)'
}
else
if
(
data
.
self
==
0x0
)
{
// eslint-disable-line
}
else
if
(
data
.
self
==
0x0
)
{
// eslint-disable-line
color
=
'var(--gray)'
color
=
'var(--gray)'
}
}
return
(
return
(
<
label
className=
'mb-0'
style=
{
{
color
:
data
.
isProperty
?
'var(--info)'
:
''
,
whiteSpace
:
'pre-wrap'
}
}
>
<
label
className=
'mb-0'
style=
{
{
color
:
data
.
isProperty
?
'var(--info)'
:
''
,
whiteSpace
:
'pre-wrap'
}
}
>
{
' '
+
key
}
:
{
' '
+
key
}
:
<
label
className=
'mb-0'
style=
{
{
color
}
}
>
<
label
className=
'mb-0'
style=
{
{
color
}
}
>
{
' '
+
data
.
self
}
{
' '
+
data
.
self
}
</
label
>
</
label
>
<
label
style=
{
{
fontStyle
:
'italic'
}
}
>
<
label
style=
{
{
fontStyle
:
'italic'
}
}
>
{
data
.
isProperty
||
!
data
.
type
?
''
:
' '
+
data
.
type
}
{
data
.
isProperty
||
!
data
.
type
?
''
:
' '
+
data
.
type
}
</
label
>
</
label
>
</
label
>
</
label
>
)
)
}
catch
(
e
)
{
return
(<></>)
}
}
}
return
(
return
(
...
...
libs/remix-ui/debugger-ui/src/utils/solidityTypeFormatter.ts
View file @
6a1512f9
...
@@ -4,41 +4,45 @@ import { ExtractData } from '../types' // eslint-disable-line
...
@@ -4,41 +4,45 @@ import { ExtractData } from '../types' // eslint-disable-line
export
function
extractData
(
item
,
parent
):
ExtractData
{
export
function
extractData
(
item
,
parent
):
ExtractData
{
const
ret
:
ExtractData
=
{}
const
ret
:
ExtractData
=
{}
if
(
item
.
isProperty
)
{
if
(
item
.
isProperty
||
!
item
.
type
)
{
return
item
return
item
}
}
if
(
item
.
type
.
lastIndexOf
(
']'
)
===
item
.
type
.
length
-
1
)
{
try
{
ret
.
children
=
(
item
.
value
||
[]).
map
(
function
(
item
,
index
)
{
if
(
item
.
type
.
lastIndexOf
(
']'
)
===
item
.
type
.
length
-
1
)
{
return
{
key
:
index
,
value
:
item
}
ret
.
children
=
(
item
.
value
||
[]).
map
(
function
(
item
,
index
)
{
})
return
{
key
:
index
,
value
:
item
}
ret
.
children
.
unshift
({
})
key
:
'length'
,
ret
.
children
.
unshift
({
value
:
{
key
:
'length'
,
self
:
(
new
BN
(
item
.
length
.
replace
(
'0x'
,
''
),
16
)).
toString
(
10
),
value
:
{
type
:
'uint'
,
self
:
(
new
BN
(
item
.
length
.
replace
(
'0x'
,
''
),
16
)).
toString
(
10
),
isProperty
:
true
type
:
'uint'
,
}
isProperty
:
true
})
}
ret
.
isArray
=
true
})
ret
.
self
=
parent
.
isArray
?
''
:
item
.
type
ret
.
isArray
=
true
ret
.
cursor
=
item
.
cursor
ret
.
self
=
parent
.
isArray
?
''
:
item
.
type
ret
.
hasNext
=
item
.
hasNext
ret
.
cursor
=
item
.
cursor
}
else
if
(
item
.
type
.
indexOf
(
'struct'
)
===
0
)
{
ret
.
hasNext
=
item
.
hasNext
ret
.
children
=
Object
.
keys
((
item
.
value
||
{})).
map
(
function
(
key
)
{
}
else
if
(
item
.
type
.
indexOf
(
'struct'
)
===
0
)
{
return
{
key
:
key
,
value
:
item
.
value
[
key
]
}
ret
.
children
=
Object
.
keys
((
item
.
value
||
{})).
map
(
function
(
key
)
{
})
return
{
key
:
key
,
value
:
item
.
value
[
key
]
}
ret
.
self
=
item
.
type
})
ret
.
isStruct
=
true
ret
.
self
=
item
.
type
}
else
if
(
item
.
type
.
indexOf
(
'mapping'
)
===
0
)
{
ret
.
isStruct
=
true
ret
.
children
=
Object
.
keys
((
item
.
value
||
{})).
map
(
function
(
key
)
{
}
else
if
(
item
.
type
.
indexOf
(
'mapping'
)
===
0
)
{
return
{
key
:
key
,
value
:
item
.
value
[
key
]
}
ret
.
children
=
Object
.
keys
((
item
.
value
||
{})).
map
(
function
(
key
)
{
})
return
{
key
:
key
,
value
:
item
.
value
[
key
]
}
ret
.
isMapping
=
true
})
ret
.
self
=
item
.
type
ret
.
isMapping
=
true
}
else
{
ret
.
self
=
item
.
type
ret
.
children
=
null
}
else
{
ret
.
self
=
item
.
value
ret
.
children
=
null
ret
.
type
=
item
.
type
ret
.
self
=
item
.
value
ret
.
type
=
item
.
type
}
}
catch
(
e
)
{
console
.
log
(
e
)
}
}
return
ret
return
ret
}
}
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