diff options
author | Alessandro Gatti <a.gatti@frob.it> | 2025-01-29 16:39:22 +0100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-05-29 12:12:39 +1000 |
commit | 555f1cf4885c65c9ff08e84f068fa175d3d8127d (patch) | |
tree | cbea56b909b51f8bda8c54605169b97640f641a3 /py | |
parent | eccd23feb6ba32abca2a26978501a53ff4e25fe0 (diff) |
py/asmxtensa: Make the generated code dumper work on mpy-cross.
This commit fixes compilation errors occurring when enabling the Xtensa
code dumper inside mpy-cross.
The original code was meant to dump the code from an Xtensa device
itself, but for debugging the inline assembler this functionality was
also needed off-line. The changes involve solving a signed/unsigned
mismatch that was not much of a problem for the 8266's gcc version but
made modern compilers complain, and using the printf formatter for
pointers when it comes to printing code addresses.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
Diffstat (limited to 'py')
-rw-r--r-- | py/asmxtensa.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py/asmxtensa.c b/py/asmxtensa.c index 41bfcb54e..11b61ad94 100644 --- a/py/asmxtensa.c +++ b/py/asmxtensa.c @@ -49,9 +49,9 @@ void asm_xtensa_end_pass(asm_xtensa_t *as) { if (as->base.pass == MP_ASM_PASS_EMIT) { uint8_t *d = as->base.code_base; printf("XTENSA ASM:"); - for (int i = 0; i < ((as->base.code_size + 15) & ~15); ++i) { + for (size_t i = 0; i < ((as->base.code_size + 15) & ~15); ++i) { if (i % 16 == 0) { - printf("\n%08x:", (uint32_t)&d[i]); + printf("\n%p:", &d[i]); } if (i % 2 == 0) { printf(" "); |