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
7ca2763f
Commit
7ca2763f
authored
Nov 18, 2013
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
write_debug_record should dump info recursively; close #1581
parent
52070a98
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
src/dump.c
src/dump.c
+18
-9
No files found.
src/dump.c
View file @
7ca2763f
...
...
@@ -384,7 +384,7 @@ write_lineno_record(mrb_state *mrb, mrb_irep *irep, uint8_t* bin)
bin
+=
rlen
;
size
+=
rlen
;
for
(
i
=
0
;
i
<
irep
->
rlen
;
i
++
)
{
rlen
=
write_lineno_record
_1
(
mrb
,
irep
,
bin
);
rlen
=
write_lineno_record
(
mrb
,
irep
,
bin
);
bin
+=
rlen
;
size
+=
rlen
;
}
...
...
@@ -405,7 +405,6 @@ write_section_lineno(mrb_state *mrb, mrb_irep *irep, uint8_t *bin)
section_size
+=
sizeof
(
struct
rite_section_lineno_header
);
rlen
=
write_lineno_record
(
mrb
,
irep
,
cur
);
cur
+=
rlen
;
section_size
+=
rlen
;
write_section_lineno_header
(
mrb
,
section_size
,
bin
);
...
...
@@ -498,7 +497,7 @@ get_filename_table_size(mrb_state *mrb, mrb_irep *irep, mrb_sym **fp, size_t *lp
}
static
int
write_debug_record
(
mrb_state
*
mrb
,
mrb_irep
*
irep
,
uint8_t
*
bin
,
mrb_sym
const
*
filenames
,
size_t
filenames_len
)
write_debug_record
_1
(
mrb_state
*
mrb
,
mrb_irep
*
irep
,
uint8_t
*
bin
,
mrb_sym
const
*
filenames
,
size_t
filenames_len
)
{
uint8_t
*
cur
;
uint32_t
f_idx
;
...
...
@@ -551,6 +550,22 @@ write_debug_record(mrb_state *mrb, mrb_irep *irep, uint8_t *bin, mrb_sym const*
return
ret
;
}
static
int
write_debug_record
(
mrb_state
*
mrb
,
mrb_irep
*
irep
,
uint8_t
*
bin
,
mrb_sym
const
*
filenames
,
size_t
filenames_len
)
{
uint32_t
size
,
len
;
size_t
irep_no
;
size
=
len
=
write_debug_record_1
(
mrb
,
irep
,
bin
,
filenames
,
filenames_len
);
bin
+=
len
;
for
(
irep_no
=
0
;
irep_no
<
irep
->
rlen
;
irep_no
++
)
{
len
=
write_debug_record
(
mrb
,
irep
->
reps
[
irep_no
],
bin
,
filenames
,
filenames_len
);
bin
+=
len
;
size
+=
len
;
}
return
size
;
}
static
int
write_filename_table
(
mrb_state
*
mrb
,
mrb_irep
*
irep
,
uint8_t
**
cp
,
mrb_sym
**
fp
,
size_t
*
lp
)
{
...
...
@@ -614,13 +629,7 @@ write_section_debug(mrb_state *mrb, mrb_irep *irep, uint8_t *cur)
// debug records
dlen
=
write_debug_record
(
mrb
,
irep
,
cur
,
filenames
,
filenames_len
);
cur
+=
dlen
;
section_size
+=
dlen
;
for
(
i
=
0
;
i
<
irep
->
rlen
;
i
++
)
{
dlen
=
write_debug_record
(
mrb
,
irep
->
reps
[
i
],
cur
,
filenames
,
filenames_len
);
cur
+=
dlen
;
section_size
+=
dlen
;
}
memcpy
(
header
->
section_identify
,
RITE_SECTION_DEBUG_IDENTIFIER
,
sizeof
(
header
->
section_identify
));
uint32_to_bin
(
section_size
,
header
->
section_size
);
...
...
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