Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
a4ac5b9f
Commit
a4ac5b9f
authored
10 years ago
by
Paul Sokolovsky
Browse files
Options
Downloads
Patches
Plain Diff
showbc: Make sure it's possible to trace MAKE_FUNCTION arg to actual bytecode.
parent
dd0dee3a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
py/bc.h
+1
-1
1 addition, 1 deletion
py/bc.h
py/emitglue.c
+1
-1
1 addition, 1 deletion
py/emitglue.c
py/showbc.c
+7
-6
7 additions, 6 deletions
py/showbc.c
with
9 additions
and
8 deletions
py/bc.h
+
1
−
1
View file @
a4ac5b9f
...
...
@@ -51,7 +51,7 @@ typedef struct _mp_code_state {
mp_vm_return_kind_t
mp_execute_bytecode
(
const
byte
*
code
,
const
mp_obj_t
*
args
,
uint
n_args
,
const
mp_obj_t
*
args2
,
uint
n_args2
,
mp_obj_t
*
ret
);
mp_vm_return_kind_t
mp_execute_bytecode2
(
mp_code_state
*
code_state
,
volatile
mp_obj_t
inject_exc
);
void
mp_bytecode_print
(
const
byte
*
code
,
int
len
);
void
mp_bytecode_print
(
const
void
*
descr
,
const
byte
*
code
,
int
len
);
void
mp_bytecode_print2
(
const
byte
*
code
,
int
len
);
// Helper macros to access pointer with least significant bit holding a flag
...
...
This diff is collapsed.
Click to expand it.
py/emitglue.c
+
1
−
1
View file @
a4ac5b9f
...
...
@@ -81,7 +81,7 @@ void mp_emit_glue_assign_bytecode(mp_raw_code_t *rc, byte *code, uint len, uint
#endif
#if MICROPY_DEBUG_PRINTERS
if
(
mp_verbose_flag
>
0
)
{
mp_bytecode_print
(
code
,
len
);
mp_bytecode_print
(
rc
,
code
,
len
);
}
#endif
}
...
...
This diff is collapsed.
Click to expand it.
py/showbc.c
+
7
−
6
View file @
a4ac5b9f
...
...
@@ -56,7 +56,7 @@
void
mp_bytecode_print2
(
const
byte
*
ip
,
int
len
);
void
mp_bytecode_print
(
const
byte
*
ip
,
int
len
)
{
void
mp_bytecode_print
(
const
void
*
descr
,
const
byte
*
ip
,
int
len
)
{
const
byte
*
ip_start
=
ip
;
// get code info size
...
...
@@ -66,7 +66,8 @@ void mp_bytecode_print(const byte *ip, int len) {
qstr
source_file
=
code_info
[
4
]
|
(
code_info
[
5
]
<<
8
)
|
(
code_info
[
6
]
<<
16
)
|
(
code_info
[
7
]
<<
24
);
qstr
block_name
=
code_info
[
8
]
|
(
code_info
[
9
]
<<
8
)
|
(
code_info
[
10
]
<<
16
)
|
(
code_info
[
11
]
<<
24
);
printf
(
"File %s, code block '%s' (%d bytes)
\n
"
,
qstr_str
(
source_file
),
qstr_str
(
block_name
),
len
);
printf
(
"File %s, code block '%s' (descriptor: %p, bytecode @%p %d bytes)
\n
"
,
qstr_str
(
source_file
),
qstr_str
(
block_name
),
descr
,
code_info
,
len
);
// bytecode prelude: state size and exception stack size; 16 bit uints
{
...
...
@@ -434,25 +435,25 @@ void mp_bytecode_print2(const byte *ip, int len) {
case
MP_BC_MAKE_FUNCTION
:
DECODE_PTR
;
printf
(
"MAKE_FUNCTION
"
UINT_FMT
,
unum
);
printf
(
"MAKE_FUNCTION
%p"
,
(
void
*
)
unum
);
break
;
case
MP_BC_MAKE_FUNCTION_DEFARGS
:
DECODE_PTR
;
printf
(
"MAKE_FUNCTION_DEFARGS
"
UINT_FMT
,
unum
);
printf
(
"MAKE_FUNCTION_DEFARGS
%p"
,
(
void
*
)
unum
);
break
;
case
MP_BC_MAKE_CLOSURE
:
{
DECODE_PTR
;
machine_uint_t
n_closed_over
=
*
ip
++
;
printf
(
"MAKE_CLOSURE
"
UINT_FMT
"
"
UINT_FMT
,
unum
,
n_closed_over
);
printf
(
"MAKE_CLOSURE
%p
"
UINT_FMT
,
(
void
*
)
unum
,
n_closed_over
);
break
;
}
case
MP_BC_MAKE_CLOSURE_DEFARGS
:
{
DECODE_PTR
;
machine_uint_t
n_closed_over
=
*
ip
++
;
printf
(
"MAKE_CLOSURE_DEFARGS
"
UINT_FMT
"
"
UINT_FMT
,
unum
,
n_closed_over
);
printf
(
"MAKE_CLOSURE_DEFARGS
%p
"
UINT_FMT
,
(
void
*
)
unum
,
n_closed_over
);
break
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment