Skip to content

pynuttx: missing mm_initialize#18395

Merged
xiaoxiang781216 merged 1 commit intoapache:masterfrom
sumpfralle:pynuttx-missing-mm_initialize
Mar 2, 2026
Merged

pynuttx: missing mm_initialize#18395
xiaoxiang781216 merged 1 commit intoapache:masterfrom
sumpfralle:pynuttx-missing-mm_initialize

Conversation

@sumpfralle
Copy link
Contributor

Summary

Commit 6ed4ea6 renamed the function mm_initialize to mm_initialize_heap.
But the corresponding symbol name in pynuttx was not updated.
The memory-related pynuttx functions (e.g. mm dump) do not work anymore since then.

Impact

The python-based support for gdb debugging now supports the memory-related features again.

Testing

Previously the following stack trace was emitted when starting gdb with the pynuttx extension:

Ignore module: mm, error: Function "mm_initialize" not defined.
Traceback (most recent call last):
  File "external/nuttx/tools/pynuttx/nxgdb/__init__.py", line 54, in init_gdb_commands
    module = importlib.import_module(f"{__package__}.{m}")
  File "/usr/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "external/nuttx/tools/pynuttx/nxgdb/mm.py", line 366, in <module>
    class MMNode(gdb.Value, p.MMFreeNode):
    ...<148 lines>...
            return MMNode.MM_ALLOCNODE_OVERHEAD
  File "external/nuttx/tools/pynuttx/nxgdb/mm.py", line 377, in MMNode
    MM_MIN_CHUNK = utils.get_symbol_value("MM_MIN_CHUNK", locspec="mm_initialize")
  File "external/nuttx/tools/pynuttx/nxgdb/utils.py", line 450, in get_symbol_value
    gdb.execute(f"list {locspec}", to_string=True)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gdb.error: Function "mm_initialize" not defined.

(a similar stack trace was repeated multiple times for various commands)

Now there is no stacktrace anymore. The gdb command mm dump works again.

@github-actions github-actions bot added Area: Tooling Size: XS The size of the change in this PR is very small labels Feb 15, 2026
@simbit18
Copy link
Contributor

@sumpfralle please fix

../nuttx/tools/checkpatch.sh -c -u -m -g 37226646fc941c3e5f9062ea6bb391785b69277a..HEAD
❌ Missing Signed-off-by
All done! ✨ 🍰 ✨
1 file would be left unchanged.
Used config files:
    1: .codespellrc
Some checks failed. For contributing guidelines, see:
  https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md
Error: Process completed with exit code 1.

Copy link
Contributor

@fdcavalcanti fdcavalcanti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix CI issue please. LGTM.

@sumpfralle sumpfralle force-pushed the pynuttx-missing-mm_initialize branch from f7a1a53 to 6e275fe Compare March 1, 2026 20:51
Commit 6ed4ea6 renamed the function `mm_initialize` to
`mm_initialize_heap`.

This caused the pynuttx modules (e.g. `mm dump`) to be missing.

Signed-off-by: Lars Kruse <devel@sumpfralle.de>
@sumpfralle sumpfralle force-pushed the pynuttx-missing-mm_initialize branch from 6e275fe to 8a0ea27 Compare March 1, 2026 20:54
@sumpfralle
Copy link
Contributor Author

Added signoff.

@xiaoxiang781216 xiaoxiang781216 merged commit 2cca9a2 into apache:master Mar 2, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Tooling Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants