Commit graph

7 commits

Author SHA1 Message Date
xuxingliang
28b2e01c22 nxgdb: fix style issue
Fix style issue reported after upgrading flake8 to 7.2.0

1 file would be left unchanged.
/home/nuttx/tools/pynuttx/nxgdb/utils.py:237:5: F824  is unused: name is never assigned in scope
    global g_type_cache
    ^
/home/nuttx/tools/pynuttx/nxgdb/utils.py:294:5: F824  is unused: name is never assigned in scope
    global long_type
    ^

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-06-13 20:37:04 +08:00
chenzhijia
341292064d nxgdb/utils.py: Fix source gdbinit.py script error report
Registering NuttX GDB commands from /home/mi/code/stable_oh2/nuttx/tools/pynuttx/nxgdb
set pagination off
set python print-stack full
"handle SIGUSR1 "nostop" "pass" "noprint"
Load macro: /tmp/6024dea73606400ae39a7b7da42cecbf.json
Please pip install debugpyIgnore module: elf, error: 'NoneType' object has no attribute 'code'
Traceback (most recent call last):
  File "/home/mi/code/stable_oh2/nuttx/tools/pynuttx/nxgdb/_init_.py", line 54, in init_gdb_commands
    module = importlib.import_module(f"{_package_}.{m}")
  File "/usr/lib/python3.10/importlib/_init_.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/mi/code/stable_oh2/nuttx/tools/pynuttx/nxgdb/elf.py", line 35, in <module>
    CONFIG_ARCH_USE_SEPARATED_SECTION = has_field("struct module_s", "sectalloc")
  File "/home/mi/code/stable_oh2/nuttx/tools/pynuttx/nxgdb/utils.py", line 488, in has_field
    return get_type_field(obj, field) is not None
  File "/home/mi/code/stable_oh2/nuttx/tools/pynuttx/nxgdb/utils.py", line 267, in get_type_field
    while t.code in (gdb.TYPE_CODE_PTR, gdb.TYPE_CODE_ARRAY, gdb.TYPE_CODE_TYPEDEF):
AttributeError: 'NoneType' object has no attribute 'code'
No symbol g_version found in memory, skipping version check

Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
2025-06-13 20:37:04 +08:00
xuxingliang
00304a18ed nxgdb/fs: fix exception when failed to parse symbol
Parse struct fields to determine array length.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-06-13 20:37:04 +08:00
Lars Kruse
3ce85ca54e style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
Lars Kruse
4568110d63 fix misspelled names in locally scoped code
These misspelled words are used in strictly local scopes.
Renaming these variables should not cause any problems.
2025-05-15 10:12:12 +08:00
xuxingliang
06c7e2a02e nxgdb/utils: add has_field and fix ArrayIterator
1. Add method to check if an object has specified field.
2. Fix Array iterator that walrus expression should store result of the
   function, instead of the compare result.

Note that walrus operation has lowest priority except ','.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-18 11:16:17 -03:00
yinshengkai
50fb43e23b tools: rename tools/gdb/nuttxgdb to tools/pynuttx/nxgdb
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2025-02-02 14:02:24 +08:00
Renamed from tools/gdb/nuttxgdb/utils.py (Browse further)