yangao1
ab3aa41f39
tools/gdb/fs.py: add print fdinfo,modify the print format
...
Execute fdinfo or fdinfo -p pid.
(gdb) fdinfo
PID: 0
FD OFLAGS POS PATH BACKTRACE
0 3 0 /dev/console 0x4028ff0c <sched_backtrace+48> /home/neo/projects/vela2/nuttx/sched/sched/sched_backtrace.c:105
0x402888f8 <file_allocate_from_tcb+236> /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:615
0x402979d0 <nx_vopen+104> /home/neo/projects/vela2/nuttx/fs/vfs/fs_open.c:326
0x40297ad4 <nx_open+116> /home/neo/projects/vela2/nuttx/fs/vfs/fs_open.c:449
0x40291eb4 <group_setupidlefiles+28> /home/neo/projects/vela2/nuttx/sched/group/group_setupidlefiles.c:75
0x4028df94 <nx_start+628> /home/neo/projects/vela2/nuttx/sched/init/nx_start.c:651
0x4028119c <arm64_boot_primary_c_routine+16> /home/neo/projects/vela2/nuttx/arch/arm64/src/common/arm64_boot.c:205
1 3 0 /dev/console 0x4028ff0c <sched_backtrace+48> /home/neo/projects/vela2/nuttx/sched/sched/sched_backtrace.c:105
0x40289574 <file_dup3+248> /home/neo/projects/vela2/nuttx/fs/vfs/fs_dup2.c:177
0x40288b88 <nx_dup3_from_tcb+176> /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:314
0x40288c64 <nx_dup2_from_tcb+16> /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:901
0x40288c88 <nx_dup2+28> /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:924
0x40291ec4 <group_setupidlefiles+44> /home/neo/projects/vela2/nuttx/sched/group/group_setupidlefiles.c:84
0x4028df94 <nx_start+628> /home/neo/projects/vela2/nuttx/sched/init/nx_start.c:651
0x4028119c <arm64_boot_primary_c_routine+16> /home/neo/projects/vela2/nuttx/arch/arm64/src/common/arm64_boot.c:205
2 3 0 /dev/console 0x4028ff0c <sched_backtrace+48> /home/neo/projects/vela2/nuttx/sched/sched/sched_backtrace.c:105
0x40289574 <file_dup3+248> /home/neo/projects/vela2/nuttx/fs/vfs/fs_dup2.c:177
0x40288b88 <nx_dup3_from_tcb+176> /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:314
0x40288c64 <nx_dup2_from_tcb+16> /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:901
0x40288c88 <nx_dup2+28> /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:924
0x40291ed0 <group_setupidlefiles+56> /home/neo/projects/vela2/nuttx/sched/group/group_setupidlefiles.c:117
0x4028df94 <nx_start+628> /home/neo/projects/vela2/nuttx/sched/init/nx_start.c:651
0x4028119c <arm64_boot_primary_c_routine+16> /home/neo/projects/vela2/nuttx/arch/arm64/src/common/arm64_boot.c:205
Signed-off-by: yangao1 <yangao1@xiaomi.com>
2024-11-22 12:30:12 +08:00
zhengyu9
136b7065b7
gdb tools: print inode info
...
go through each inode and print its structure info
in the form like below:
├── i_name: bin, i_ino: 51
│ i_parent: , i_peer: data, i_child: , i_crefs: 1, i_flags: 3
│ ......(other info)
│ ├── i_name: audio, i_ino: 5
│ │ i_parent: dev, i_peer: binder, i_child: mixer......
Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
2024-11-22 12:30:12 +08:00
zhengyu9
fab9670857
gdb tools: mount command
...
support mount command in gdb, print mount information
test result:
/bin type binfs
/data type hostfs
/etc type romfs
/proc type procfs
/resource type hostfs
/tmp type tmpfs
Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
2024-11-22 12:30:12 +08:00
Neo Xu
1518f8bdb8
tools/gdb: fix type and comments
...
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-11-21 23:08:55 +08:00
anjiahao
cd78de7c63
memleak:Add reminder information
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-21 23:08:55 +08:00
anjiahao
b507a57158
thread.py: fix bug that ARM-A TCB info register offset is discontinuous
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
0f1e2cc7dc
tools/gdb: make it compatible with older gdb
...
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
anjiahao
f53869f86f
memleak:use global symbol to search all global variables
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-21 23:08:55 +08:00
anjiahao
8575f11e1e
memdump.py:use import_check inside of once_init
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-21 23:08:55 +08:00
anjiahao
e71d45ce86
utils.py:support import check and requirements.txt
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-21 23:08:55 +08:00
buxiasen
bf2d6a3554
tools/gdb/memdump: add biggest/orphon dump.
...
information prefer from gdb to python class
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
fc0f7365bb
tools/gdb: fix import error for certain gdb
...
For the prebuilt arm-none-eabi-gdb, there's no python builtin module
available.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
de5f70b3c8
tools/gdb: remove 'Nx' prefix for unique commands
...
1. Remove Nx prefix for nuttx unique commands.
2. Add docstring for most of the commands in order to show help message.
3. Add 'init_once' method for Memmap command. The prerequisite is checked the moment it's used.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
3a46b6e6af
tools/gdb: cache gdb.Type result
...
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
1d25eed55c
tools/gdb: fix CONFIG_SMP_NCPUS could be none
...
The macro could be eliminated by optimization.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
715c3ab079
tools/gdb: fix notification suppress not working
...
"on" string is always in the word 'notification'. Should use "is on" instead.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
ad1be85be7
tools/gdb: catch exception when there's no selected frame
...
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
bbf51ba071
tools/gdb: no need to read the whole memory firstly
...
Read the whole memory costs additional time. When the number memory nodes is
small, test on qemu shows that read memory directly is faster.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
12783c031c
tools/gdb: only define c and s when thread comands enabled
...
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
yinshengkai
b81212e96f
tools/gdb: Add memory fragmentation rate calculation
...
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
9dbf58f1be
tools/gdb: optimize memleak speed
...
1. Avoid to_bytes by using memoryview directly.
2. No need to call gdb to cast to char *.
3. Cache the memory data without invoke gdb in every iteration.
4. Do code cleanup.
memleak speed improved from 261.93 seconds to 29.9 seconds for x4b
usecase.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
4e067fd762
tool/gdb: use second inferior to get symbol
...
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
yinshengkai
614e07c8f0
tools/gdb: supports generating memory map images
...
Display all memory nodes in a picture, which can be used to help analyze memory fragmentation
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
2f8c9070c5
tools/gdb: use native thread command
...
For coredump, gdb-stub, the thread command is natively supported.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
anjiahao
089877c693
memleak:support use gdb to catching absolute memory leaks
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-21 23:08:55 +08:00
Peter Bee
c0f776dbc3
follow upstream change & fix minor things
...
Signed-off-by: Peter Bee <pbjd97@gmail.com>
2024-11-20 16:32:05 -03:00
Marco Casaroli
dac3f315a1
uf2
2024-11-20 16:32:05 -03:00
Neo Xu
edc410f26f
format code to pass CI
...
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-11-20 09:04:22 +08:00
buxiasen
96a3bc2b5c
tools/gdb: fix if restore_regs failed script abort
...
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
eded2017d4
memdump.py:Enhance the printing function of memdump
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
477f7b92ee
tools/gdb/memdump.py:fix mempool memory traversal missing nodes
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
xuxingliang
8264c05c15
tools/gdb: use f string where possible
...
misc update.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-20 09:04:22 +08:00
Gao Jiawei
06d640a677
implement ps
nx shell utility for ez debugging with GDB
...
Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2024-11-20 09:04:22 +08:00
Gao Jiawei
e31fe0fb55
add custom command and APIs for retrieving/displaying stack statistics
...
Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2024-11-20 09:04:22 +08:00
Gao Jiawei
8edb9283ba
trivial modification on the utility module
...
1. add get macro related inteface, for now we have't fully implemented
the way to expand and evalute macros at runtime. We just deal with some macros that can be expand and evaluate into essential constants that will be needed later.
2. rearrange utility functions in a different order
3. reimplment the get register API to make it more commonly used
Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2024-11-20 09:04:22 +08:00
Gao Jiawei
76db3c8939
enable stack trace printing on excpetion
...
Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
e0bea987d1
gdb python plugin:support dump list member
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
daac426f79
gdb python plugin:add hexdump command support
...
hexdump useful to debug
format such as:
(gdb) hexdump 0x0062fd30 500
0062fd30 73 68 6f 77 5f 76 61 72 69 61 62 6c 65 3a 20 45 show_variable: E
0062fd40 52 52 4f 52 20 56 61 72 69 61 62 6c 65 3d 25 73 RROR Variable=%s
0062fd50 20 68 61 73 20 74 68 65 20 77 72 6f 6e 67 20 76 has the wrong v
0062fd60 61 6c 75 65 0a 00 6f 73 74 65 73 74 5f 6d 61 69 alue..ostest_mai
0062fd70 6e 2e 63 00 73 68 6f 77 5f 76 61 72 69 61 62 6c n.c.show_variabl
0062fd80 65 3a 20 45 52 52 4f 52 20 56 61 72 69 61 62 6c e: ERROR Variabl
0062fd90 65 3d 25 73 20 68 61 73 20 61 20 76 61 6c 75 65 e=%s has a value
0062fda0 20 77 68 65 6e 20 69 74 20 73 68 6f 75 6c 64 20 when it should
0062fdb0 6e 6f 74 0a 00 73 68 6f 77 5f 76 61 72 69 61 62 not..show_variab
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
635e324e9a
gdb/thread.py:simplify the logic of nxsetregs
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
wangmingrong
8eb1047595
gdb python tools: fix command "info thread" echo error
...
Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
eccd26a162
gdb/thread.py:Print colorful
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
5aaa31337a
gdb/thread.py:fix a bug when use 'up' then use 'thread'
...
Python Exception <class 'gdb.error'>: Attempt to assign to an unmodifiable value.
Python Exception <class 'gdb.error'>: Error occurred in Python: Attempt to assign to an unmodifiable value.
Error occurred in Python: Error occurred in Python: Attempt to assign to an unmodifiable value.
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
2292a36983
gdb/thread.py:change show gdb index/tid/pid format
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
anjiahao
852e683fa3
python/gdb:fix use thread command on running task bug
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-20 09:04:22 +08:00
ligd
5c939d8140
gdb: devide tid & pid, add holder logout when waiting mutex
...
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-11-20 09:04:22 +08:00
raiden00pl
7e42ca2538
boards/stm32: split nucleo-f4x1re into separate boards
...
Split nucleo-f4x1re into nucleo-f401re and nucleo-f411re.
These are separate boards and should be in separate directories as it's
done for all other nucleo boards in NuttX
2024-11-19 13:28:42 +01:00
hujun5
19b4911d7f
arch: remove up_current_regs in common code
...
reason:
When entering an exception or interrupt, there are two sets of registers:
one is the "running regs", which we need to save,
and the other is the "ready to running regs", which we may soon use.
For consistency in logic, we can always store the "running regs" in the regs field of g_running_tasks,
otherwise it may lead to errors in the storage location of the "running regs."
When we need to access the "running regs," we should uniformly retrieve them from the regs field of g_running_tasks.
As the next step, we will rename the set_current_regs/up_current_regs functions
for each architecture to more appropriate names, solely for the purpose of identifying interrupts.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-15 18:25:35 +08:00
wangmingrong1
17ce9b86c1
gcov: Correct existing gcov configuration
...
1. add CONFIG_COVERAGE_ALL to replace CONFIG_SCHED_GCOV_ALL
2. Correct all SCHED_GCOV, SCHED_GCOV_ALL
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-15 01:05:16 +08:00
xuxin19
d2a7e454bb
build(qemu):add a qemu compilation configuration with application
...
enable various types of common applications and libraries, and enable CMake CI checks.
To avoid regression issues in the build system
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-14 22:50:49 +08:00
anjiahao
6554ed4d66
get g_tcbinfo just use elf memory
...
g_tcbinfo is const data, thus elf memmory is more reliable than other
method in case of corruption etc.
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-14 13:30:34 +08:00