Skip to content

pynuttx: missing mm_initialize#18395

Open
sumpfralle wants to merge 1 commit intoapache:masterfrom
sumpfralle:pynuttx-missing-mm_initialize
Open

pynuttx: missing mm_initialize#18395
sumpfralle wants to merge 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.

Commit 6ed4ea6 renamed the function `mm_initialize` to
`mm_initialize_heap`.

This caused the pynuttx modules (e.g. `mm dump`) to be missing.
@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.

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.

6 participants