Commit Graph

2081 Commits

Author SHA1 Message Date
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
dongjiuzhu1
7927c8d105 tools/pynuttx: update fs.py base on new structure fd and file
Update the Python script based on the PR "Separate file
descriptors from file descriptions" in fs/vfs.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-06-12 18:12:42 +08:00
dongjiuzhu1
9ca5c1d9c6 fs/file: unify prefix f_ for member locked
update locked to f_locked

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-06-12 18:12:42 +08:00
Alin Jerpelea
895154881c tools/doreleasenotes: remove deprecater API
remove old API since github removed deprecated API support

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2025-05-27 20:34:54 +08:00
Lars Kruse
e5b675d4dc refactor: fix spelling in private field names
Fix some misspelled field names.
These field names seem to be used only in private contexts.
Thus, the probability of external code accessing these fields is very
low.
In the rare case of external usage, compile time errors will easily
direct users to the new field name.
2025-05-24 09:44:22 -03:00
raiden00pl
442bc1c041 tools/nxstyle.c: fix defined but not used warning
fix defined but not used warning from CI:

  Warning: nxstyle.c:767:13: warning: ‘backslash_to_slash’ defined but not used [-Wunused-function]
    767 | static void backslash_to_slash(char *str)

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-23 11:26:07 -03:00
simbit18
889a26db1d tools/ci/testlist/arm-05.dat: removed missing entries
Removed from the arm-05.dat file the entries:

CMake,nrf52832-dk:buttons
CMake,nrf52832-dk:wdog

CMake,nrf52840-dk:adc
CMake,nrf52840-dk:buttons
CMake,nrf52840-dk:pwm
CMake,nrf52840-dk:qspi
CMake,nrf52840-dk:timer

present in the jumbo configuration

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-05-23 09:29:43 +02:00
Lars Kruse
f4cc2c2628 tools/checkpatch: avoid repeated output of codespell configuration filename 2025-05-23 10:48:41 +08:00
Lars Kruse
3ce85ca54e style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
simbit18
8776147783 tools/Config.mk: add -DHAVE_STRNDUP=1
In all POSIX environments (Linux, Cygwin, MSYS2, macOS)
strndup() function is  available.

add HOSTCFLAGS += -DHAVE_STRTOK_C=1 -DHAVE_STRNDUP=1

Required after PR #16396

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-05-20 08:29:05 +08:00
simbit18
3b27b44435 tools/nxstyle.c: fix error Relative file path on Windows Native
fix
error: Relative file path does not match actual file

Windows paths are different from Unix.

Added:

realpath replacement macro.

 my_strndup() Implementation of strndup() for Windows Native.

backslash_to_slash() Replace backslashes \ to forward slashes /. Used to verify the relative path of a file.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-05-19 22:30:49 +08:00
simbit18
91027563fa tools/CMakeLists.txt: Improvements to CMakeLists.txt file
More aligned to the tools/Makefile.host file

Added:
The option() command  It provides a way to enable or disable targets of the project based on the user's preference.

Default
option(NUTTX_INCLUDE_ALL_TOOLS "Build all NuttX Host Tools" ON)

Checking host system for compilation options.

Tools configure, mkconfig, mksymtab and mkversion.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-05-17 16:09:20 +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
George Poulios
2799cba36b tools/nxstyle.c: Whitelist libteec mixed case symbols
Whitelist all symbols starting with "TEEC_" and a few
entire struct field names from tee_client_api.h.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-13 10:14:01 +08:00
Kerogit
22df1ed2ab tools: add permitted mixed case suffixes to nxstyle
Newer AVR chips (DA/DB family) use mixed-case constants in header
file defining constants for I/O register values (provided
by manufacturer.)

Based on mailing list discussion, this patch adds some
of the lowercase suffixes used (the less prevalent constants
are then redefined in NuttX.)
2025-05-08 15:58:18 +08:00
Alan Carvalho de Assis
7b3aad198e ci/testlist: Don't build breadxavr board 2025-05-08 15:58:18 +08:00
simbit18
4245db2c47 tools/ci/testlist/sim-01.dat: skip build sim:can for macOS
macOS can compilation is not currently supported

[SocketCAN - Controller Area Network](https://www.kernel.org/doc/html/latest/networking/can.html)
 [Linux-CAN / SocketCAN ](https://github.com/linux-can/can-utils)

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-05-08 02:59:31 +02:00
chao an
d07bed3e6b tools/process_config: remove unused unnecessary printing
Too much unnecessary printing that meaningless to non-builder developers

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-05-05 23:49:16 +08:00
Lars Kruse
10c3930279 fix(udhcpc): missing interface name in log message
The mis-referenced variable probably did not cause an error, but simply
led to an empty string instead of the real network interface name.
2025-05-05 09:32:31 +08:00
Serg Podtynnyi
4c52f2dbeb tools: Update Unix.mk and savedefconfig.cmake for CONFIG_ARCH_BOARD_COMMON
Preserve CONFIG_ARCH_BOARD_COMMON in savedconfig

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-05-02 09:30:34 -03:00
Valentyn Korniienko
43b29a0547 Fixed empty line handling process_config.sh
This commit fixed empty line handling in the config file for being able to used KConfig-based defconfigs with the empty lines in them
2025-05-02 09:27:44 -03:00
Tim Hardisty
ed0c18c66c drivers/video/fb.c: Add startup splashscreen option
Adds Kconfig-selected splashscreen options used when the driver is first registered

* Includes a new Python script in ./tools to create RLE bitmap files
* Includes default NS logo btimaps in 320x320, 160x160 and 80x80 resolutions along with their PNG files

Signed-off-by: Tim Hardisty  timh@jti.uk.com>
2025-04-30 06:38:05 -03:00
chao an
52482219c8 libc/elf: rename modlib to libelf
Renaming "modlib" to "libelf" is more in line with the implementation content,
which makes it easier for individual developers to understand the capabilities of this module.

CONFIG_LIBC_MODLIB -> CONFIG_LIBC_ELF

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-04-11 09:43:22 +08:00
simbit18
b52c122f2c tools/host_info_dump.py: fix UnboundLocalError: local variable 'vendor_specific_module_path' referenced before assignment
fix

Traceback (most recent call last):
  File "/home/ubuntu20042/nuttxspace/nuttx/tools/host_info_dump.py", line 575, in <module>
    header = generate_header(args)
  File "/home/ubuntu20042/nuttxspace/nuttx/tools/host_info_dump.py", line 466, in generate_header
    sys.path.append(os.path.abspath(vendor_specific_module_path))
UnboundLocalError: local variable 'vendor_specific_module_path' referenced before assignment
make: *** [tools/Unix.mk:644: host_info] Error 1
2025-04-10 06:43:01 +08:00
Tiago Medicci Serrano
622355b5c3 arch/xtensa/esp32s3: Fix bug regarding SPI flash operation mode
SPI flash operation modes - Dual Output (dout), Dual I/O (dio),
Quad Output (qout), Quad I/O (qio) and Octal (opi) were not being
properly selected. This commit fixes this behavior and the device
is now able to boot and initialize the proper SPI flash mode.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-08 14:44:38 +08:00
Tiago Medicci Serrano
80559890ff espressif: Simplify the selection of the SPI flash frequency
This commit simplifies the selection of the SPI flash frequency for
Espressif SoCs by using a standardized Kconfig-defined macro.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-05 11:26:32 +08:00
Tiago Medicci Serrano
b388b84af6 arch/risc-v/esp32h2: Set the default SPI flash frequency to 64MHz
The default frequency for the SPI flash chip on ESP32-H2 is 64MHz.
Although it was being set to 48MHz, this isn't a valid value. The
device, however, must be flashed using 48MHz when 64MHz is set.
2025-04-02 09:53:27 +08:00
zhangshoukui
82273b1cf5 tools/ci/testrun/script/test_framework/test_cmocka: skip Skip failed cases
[BUG] CI Test sim:citest fails intermittently for Linux sim-01 nuttx#16088
https://gist.github.com/lupyuen/849562eaf87b93411098c96ada4d43c5

nsh> cmocka --skip test_case_posix_timer|test_case_oneshot|write_default|read_default|burst_test|gpiotest01|test_playback.*|test_interaction.*|test_stress.*|test_capture.*
Cmocka Test Start.
Missing <source>
Usage: cmocka_driver_block -m <source>
Where:
  -m <source> Block device or mtd device mount location.
...
[ RUN      ] drivertest_pm
[  ERROR   ] --- 0 != 3
[   LINE   ] --- drivertest_pm.c:199: error: Failure!
[  FAILED  ] drivertest_pm
[==========] tests: 1 test(s) run.
[  PASSED  ] 0 test(s).
[  FAILED  ] tests: 1 test(s), listed below:
[  FAILED  ] drivertest_pm
...
[ RUN      ] drivertest_posix_timer
[  ERROR   ] --- 2019 is not within the range [1990, 2010]
[   LINE   ] --- drivertest_posix_timer.c:162: error: Failure!
[  FAILED  ] drivertest_posix_timer
[==========] tests: 1 test(s) run.
[  PASSED  ] 0 test(s).
[  FAILED  ] tests: 1 test(s), listed below:
[  FAILED  ] drivertest_posix_timer

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-03-28 11:19:59 +01:00
Huang Qi
0873d88f11 tools/espressif: Improve version checking by subprocess
Summary:
- Replace version checking logic using pkg_resources and importlib with a subprocess call to `esptool.py version`
- This change enhances compatibility with esptool installed via pipx and simplifies the version retrieval process

Impact:
- No functional changes; the script continues to prompt for installation if esptool is not found
- Increases maintainability by reducing dependency on Python version checks

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-03-27 02:26:47 +08:00
yangao1
ded5a6aae5 nxgdb/dmesg.py:add use gdb dump rpmsg_syslog
(gdb) dmesg
RAM log:
[01/06 02:27:05] [ 1] [cp] reset mode:1
...
[01/06 02:27:05] [ 1] [cp] Dump board_reset backtrace:
[01/06 02:27:05] [ 1] [cp] sched_dumpstack: backtrace| 1: 0x10a0d880 0x10a0a78e 0x10a0d8b6 0x10a0f29e 0x10a0f182
[01/06 02:27:05] [ 1] [cp] Time: Mon Jan  6 02:27:05 2025
---END of RAMLOG

RPMSG syslog:
dumpstack: backtrace|10: 0x10a0d880 0x10a0a78e 0x10a110de 0x10a3a482 0x10a3c4fa 0x10a23358 0x10a4aaee 0x10a34a7c
[01/06 02:27:05] [ 1] [cp] sched_dumpstack: backtrace|10: 0x10a2330a 0x10a0f1f4
[01/06 02:27:05] [ 1] [cp] sched_dumpstack: backtrace|11: 0x10a0d880 0x10a0a78e 0x10a110de 0x10a3a482 0x10a15152 0x10a0f182
[01/06 02:27:05] [ 1] [cp] sched_dumpstack: backtrace|15: 0x10a0d880 0x10a0a78e 0x10a0d8b6 0x10a174d0 0x10a3a482 0x10a3c4fa 0x10a222ee 0x10a18c66
[01/06 02:27:05] [ 1] [cp] Time: Mon Jan  6 02:27:05 2025
---END of RPMSG SYSLOG---

Signed-off-by: yangao1 <yangao1@xiaomi.com>
2025-03-27 02:18:37 +08:00
simbit18
d7681cc815 CI: Improved speed to build nuttx on MSYS2 job
After MSYS2 updated the package on GitHub
there was a slowdown in building NuttX in the MSYS2 job.

It went from an average of 6 minutes to 10 minutes !!!

The purpose of this PR is to speed up the build to decrease the usage of the Windows runner.

Modified Files
tools/ci/cibuild.sh

tools/sethost.sh

make olddefconfig -j 4 -> make olddefconfig
workaround for remove
  Cleaning...
  Configuring...
make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-03-26 22:35:19 +08:00
simbit18
34c4b15b4d tools/ci: Added CI system on Windows Native
This PR adds support for the CI system for native Windows as well. It allows you to build NuttX on GitHub and test it locally for Windows users.

With these CI tools with PowerShell scripts, it is possible to build NuttX for Windows Native using (for now only) Cmake + Ninja with the same logic as the CI system with Bash scripts.

This allows the msvc job to be used not only with the simulator (currently only with Visual Studio 17 2022), but also with other architectures using the same Windows runner to get more coverage and avoid future breakage.
As with the other jobs, we use artifacts to save the compilation result at the end of the workflow execution (previously for the simulator it was not done).

The proposed solution is based on the following additions and modified:

Modified Files
buildyml -> only CI Jobs MSVC

New Files in tools/
ci/cibuild.ps1 -> Added Powershell script for Run the CI Builds
ci/platforms/windows.ps1 -> Added Powershell script for installing toolchains and tools.
testlist/windows.dat -> Target (Add sim (msvc), risc-v arm)
tools/testbuild.ps1

We tested the NuttX build on GitHub and locally.

How we build on GitHub and test locally.

Locally
cd .\nuttx\tools\ci\

.\cibuild.ps1 -n -i -A -C -N .\testlist\windows.dat

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-03-19 19:59:44 +08:00
Tomasz 'CeDeROM' CEDRO
5ad4667a63 tools/checkpatch: Use gmake on BSD, make otherwise.
* BSD has its own BSD Make that is incompatible with GNU Make.
* When BSD is detected use (gnu) gmake in place of (bsd) make.
* This fixes nxstyle build inside tools/checkpatch.sh.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-03-19 09:09:32 +01:00
Tomasz 'CeDeROM' CEDRO
3eddfe51fa tools/bdf-converter: Fix loop termination condition.
Changing readingbitmap from bool to int, initializing it to the number
of bitmaps allocated, decrementing it each time a bitmap is consumed,
and using it as the termination condition for the while loop,
ensures that loop termination does not depend on data from the file.

Note: Patch provided by Nathan Hartman.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-03-18 10:12:23 -03:00
Ari Kimari
4bfbe82a3e arch/arm64/imx9: Support for imx9 edgelock enclave
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Moved imx9 edgelock enclave (ELE) handling from imx9_trdc.c to own imx9_ele.c file.
Add some new messages to ele API.
Updated ele fw version to 1.3.0.
Fix channel bug on imx9_ele_sendmsg() and imx9_ele_receivemsg()

Signed-off-by: Ari Kimari <ari.kimari@tii.ae>
2025-03-17 21:35:25 +02:00
Tiago Medicci Serrano
e4ca1a2de9 CI: Move esp32s3-devkit:python from xtensa-02.dat to xtensa-03.dat
This prevents CI from testing esp32s3-devkit:python automatically,
avoiding it to be overloaded. Manual testing can be triggered to
test xtensa-03.dat.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-03-08 06:49:23 -03:00
simbit18
4877e33058 tools/mksyscall: fix 106: Unexpected end of line: "FAR char * co"
line 106 exceeds the 256 character limit

106: Unexpected end of line: "FAR char * co"
make[1]: *** [makefile:108: .context] Error 4
make[1]: Leaving directory 'C:/nxtest/nuttx/syscall'
make: *** [tools/Win.mk:468: syscall\.context] Error 2

fixed tools/csvparser.h from

to

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-03-08 12:39:24 +08:00
Luchian Mihai
fd6d804623 tools/nxstyle: handle case statement
fix nxstyle so it throw error if case statement is not on new line
2025-02-21 16:26:41 -05:00
xuxingliang
1bfb42d127 nxgdb/irq: add irqinfo command
(gdb) irqinfo
IRQ  COUNT      TIME   RATE   HANDLER                                          ARGUMENT
0    0          0      N/A    mps_reserved                             0x0 <sensor_unregister>
2    0          0      N/A    mps_nmi                                  0x0 <sensor_unregister>
3    0          0      N/A    arm_hardfault                            0x0 <sensor_unregister>
4    0          0      N/A    arm_memfault                             0x0 <sensor_unregister>
5    0          0      N/A    arm_busfault                             0x0 <sensor_unregister>
6    0          0      N/A    arm_usagefault                           0x0 <sensor_unregister>
11   1          0      N/A    arm_svcall                               0x0 <sensor_unregister>
12   0          0      N/A    arm_dbgmonitor                           0x0 <up_debugpoint_remove>
14   0          0      N/A    mps_pendsv                               0x0 <up_debugpoint_remove>
15   6581421    0      N/A    systick_interrupt                        0x100010c <g_systick_lower>
49   2          0      N/A    uart_cmsdk_tx_interrupt                  0x1000010 <g_uart0port>
50   0          0      N/A    uart_cmsdk_rx_interrupt                  0x1000010 <g_uart0port>
59   2          0      N/A    uart_cmsdk_ov_interrupt                  0x1000010 <g_uart0port>
(gdb)

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-18 11:16:17 -03: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
xuxingliang
1b94d0e2cf nxgdb/mm: show pool expand queue size
nqueue has been added to output.

E.g.
(gdb) mm pool
Total 16 pools
                      total blocksize     bsize  overhead     nused     nfree    nifree   nwaiter    nqueue
 Umem@0x10048dc        4068        16        16         0         3       251         0         0         1
 Umem@0x100493c        4068        32        32         0         3       124         0         0         1
 Umem@0x100499c        4036        48        48         0        10        74         0         0         1
 Umem@0x10049fc        4036        64        64         0         1        62         0         0         1
 Umem@0x1004a5c           0        80        80         0         0         0         0         0         0
 Umem@0x1004abc           0        96        96         0         0         0         0         0         0
 Umem@0x1004b1c           0       112       112         0         0         0         0         0         0
 Umem@0x1004b7c           0       128       128         0         0         0         0         0         0
 Umem@0x1004bdc           0       144       144         0         0         0         0         0         0
 Umem@0x1004c3c           0       160       160         0         0         0         0         0         0
 Umem@0x1004c9c           0       176       176         0         0         0         0         0         0
 Umem@0x1004cfc           0       192       192         0         0         0         0         0         0
 Umem@0x1004d5c        3956       208       208         0         1        18         0         0         1
 Umem@0x1004dbc           0       224       224         0         0         0         0         0         0
 Umem@0x1004e1c           0       240       240         0         0         0         0         0         0
 Umem@0x1004e7c           0       256       256         0         0         0         0         0         0
(gdb)

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-16 11:23:38 -03:00
xuxingliang
c319863834 nxgdb/mm: fix regular expression to parse log
There could be only one space ahead of address.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-07 08:18:14 +08:00
xuxingliang
1577fe3160 nxgdb/mm: warning if corrupted memory node found
If the nodesize is 0, we cannot iterate to next node, siliently return None will cause memleak command to generate false positive report with no warnings.
Add log to indicate such case.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-07 08:18:14 +08:00
xuxingliang
ef52c68e06 nxgdb/mm: add prenode, nextnode property for mempool
So it looks like a memory node in heap thus we can process it in a unified way

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-07 08:18:14 +08:00
xuxingliang
04bd00f80a pynuttx: optimize memory leak check by skipping previously checked pointers
Reduce leak analysis time from 12s to 7.8s, achieving a 35% performance improvement that tested on an internal project.

1. Use memoryview to avoid creating int objects, reducing overhead
2. Store checked pointers in a dictionary for efficient lookups, improving performance.
3. While dictionary operations have some cost, the overall speedup is significant.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-05 09:15:27 -03:00
xuxingliang
b90638493a pynuttx: fix memleak
Only need to check used node, excluding free nodes.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-05 09:15:27 -03:00
xuxingliang
f9d8cdcca2 nxgdb/memdump: add free command
(gdb) free
name            total      used       free       maxused    maxfree    nused      nfree
GImageCache     10485756   10411964   73792      10602184   62328      217        7
uncache         10485756   127812     10357944   270512     10350560   4          2
Umem            26879516   17458732   9420784    20957888   9260768    1211       234
(gdb)

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-04 09:32:07 -03:00
xuxingliang
8995e5a66e nxgdb/fs: simplify inode print and add more options
Use Inode.__repr__ for print and use single line for all information.
Add 'verbose' and 'nodetype' option to show more details and only print specifiy node type like PIPE.
Add / to name for pseudodir.
Catch memory error when accessing node element.

E.g.

(gdb) foreach inode --nodetype pipe
        ├── run/ 0x41a27a50 PSEUDODIR
        │   ├── bt:bluetoothCS1fd26 0x4530c510 PIPE
        │   ├── bt:bluetoothCS20 0x42daae40 PIPE
        │   ├── socketpair0x457fd2e0SC20540 0x44ea27b0 PIPE
        │   └── tmp/ 0x42dd7cf0 PSEUDODIR
        │       │   └── usock/ 0x42dd6c10 PSEUDODIR
        │       │       └── speech.usockHD 0x42dc8270 PIPE
        │       ├── central_lite.socketCS5e 0x42e1e7b0 PIPE
        │       ├── central_service_lite.socketSC86 0x432ee6d0 PIPE
        │       │   └── usock/ 0x43d6ed60 PSEUDODIR
        │       │       └── speech.usockHD 0x43da2ba0 PIPE
        │       ├── uv-feature-sockSC8d 0x43540430 PIPE
        │       ├── uv-miot-sockCS54 0x42e272e0 PIPE
        │       └── uv-miot-sockSC54 0x42e270b0 PIPE

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-03 09:21:26 +01:00
xuxingliang
dc5251f9c8 nxgdb/fs: use default args
Instead of storing it to self

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2025-02-03 09:21:26 +01:00