Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
b72f3f92
Commit
b72f3f92
authored
Dec 25, 2013
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use static symbols for debug filename info
parent
c70e2f70
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
src/load.c
src/load.c
+9
-4
No files found.
src/load.c
View file @
b72f3f92
...
@@ -354,7 +354,7 @@ read_debug_record(mrb_state *mrb, const uint8_t *start, mrb_irep* irep, uint32_t
...
@@ -354,7 +354,7 @@ read_debug_record(mrb_state *mrb, const uint8_t *start, mrb_irep* irep, uint32_t
}
}
static
int
static
int
read_section_debug
(
mrb_state
*
mrb
,
const
uint8_t
*
start
,
mrb_irep
*
irep
)
read_section_debug
(
mrb_state
*
mrb
,
const
uint8_t
*
start
,
mrb_irep
*
irep
,
mrb_bool
alloc
)
{
{
const
uint8_t
*
bin
;
const
uint8_t
*
bin
;
struct
rite_section_debug_header
*
header
;
struct
rite_section_debug_header
*
header
;
...
@@ -374,7 +374,12 @@ read_section_debug(mrb_state *mrb, const uint8_t *start, mrb_irep *irep)
...
@@ -374,7 +374,12 @@ read_section_debug(mrb_state *mrb, const uint8_t *start, mrb_irep *irep)
for
(
i
=
0
;
i
<
filenames_len
;
++
i
)
{
for
(
i
=
0
;
i
<
filenames_len
;
++
i
)
{
uint16_t
f_len
=
bin_to_uint16
(
bin
);
uint16_t
f_len
=
bin_to_uint16
(
bin
);
bin
+=
sizeof
(
uint16_t
);
bin
+=
sizeof
(
uint16_t
);
if
(
alloc
)
{
filenames
[
i
]
=
mrb_intern
(
mrb
,
(
const
char
*
)
bin
,
f_len
);
filenames
[
i
]
=
mrb_intern
(
mrb
,
(
const
char
*
)
bin
,
f_len
);
}
else
{
filenames
[
i
]
=
mrb_intern_static
(
mrb
,
(
const
char
*
)
bin
,
f_len
);
}
bin
+=
f_len
;
bin
+=
f_len
;
}
}
...
@@ -452,7 +457,7 @@ mrb_read_irep(mrb_state *mrb, const uint8_t *bin)
...
@@ -452,7 +457,7 @@ mrb_read_irep(mrb_state *mrb, const uint8_t *bin)
}
}
else
if
(
memcmp
(
section_header
->
section_identify
,
RITE_SECTION_DEBUG_IDENTIFIER
,
sizeof
(
section_header
->
section_identify
))
==
0
)
{
else
if
(
memcmp
(
section_header
->
section_identify
,
RITE_SECTION_DEBUG_IDENTIFIER
,
sizeof
(
section_header
->
section_identify
))
==
0
)
{
if
(
!
irep
)
return
NULL
;
/* corrupted data */
if
(
!
irep
)
return
NULL
;
/* corrupted data */
result
=
read_section_debug
(
mrb
,
bin
,
irep
);
result
=
read_section_debug
(
mrb
,
bin
,
irep
,
FALSE
);
if
(
result
<
MRB_DUMP_OK
)
{
if
(
result
<
MRB_DUMP_OK
)
{
return
NULL
;
return
NULL
;
}
}
...
@@ -679,7 +684,7 @@ mrb_read_irep_file(mrb_state *mrb, FILE* fp)
...
@@ -679,7 +684,7 @@ mrb_read_irep_file(mrb_state *mrb, FILE* fp)
mrb_free
(
mrb
,
bin
);
mrb_free
(
mrb
,
bin
);
return
NULL
;
return
NULL
;
}
}
result
=
read_section_debug
(
mrb
,
bin
,
irep
);
result
=
read_section_debug
(
mrb
,
bin
,
irep
,
TRUE
);
mrb_free
(
mrb
,
bin
);
mrb_free
(
mrb
,
bin
);
}
}
if
(
result
<
MRB_DUMP_OK
)
return
NULL
;
if
(
result
<
MRB_DUMP_OK
)
return
NULL
;
...
...
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