-
-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core/emulator): JSON memory map dump #1557
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to merge this PR first - https://github.com/trezor/trezor-firmware/pull/1548/files
Since it includes changes necessary for uPy 1.14 version bump (and your PR is bumping uPy to 1.14 too)
core/embed/extmod/trezorobj.h
Outdated
@@ -27,6 +27,12 @@ | |||
#error Use MPZ for MicroPython long int implementation. | |||
#endif | |||
|
|||
#ifdef TREZOR_EMULATOR | |||
#define STATICTYPE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why not to just override STATIC completely for emulator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't understand reasons for STATIC
in the first place so I made the change as non-invasive as possible.
of course if you think we can switch off STATIC
that works too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for that matter, it would also remove the need for the micropython hack mentioned above, which would be good.
question is, won't removing STATIC get the emulator farther from the real thing in a noticeable way?
47abf0c
to
81c128b
Compare
81c128b
to
7fb3e5d
Compare
This is perhaps a cleaner way to expose all relevant structures for memory analysis.
7fb3e5d
to
26e4bb8
Compare
use `trezor.utils.mem_dump("somefile.json")` in a key place, then `analyze.py src/somefile.json` to look at what is going on
26e4bb8
to
90cda82
Compare
this is now ready to merge, no additional micropython patches required @prusnak do you want to look at it again or should I just merge? |
use
trezor.utils.mem_dump("somefile.json")
in a key place, then./tools/analyze-memory-dump.py src/somefile.json
to look at what is going on. clickable analysis is inmemorymap.html
it's pretty nice :)
requires the following micropython hack:7f15dc3
(#6)