Oopenvela-robotnxgdb: set trust read only on
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
tools/nxgdbmcp: remove some legacy code nxgdbmcp contains some legacy code. This is because in its earliest design, nxgdbmcp had the ability to actively launch a GDB child process to hijack its stdio interaction, thus performing more complex actions. However, now it can only interact with GDB through gdbrpc, so some actions should be assumed to have been performed by the user. We found that adapting for each command results in significant token consumption for users. Firstly, the native command support for GDB can be removed. Secondly, regarding the nxgdb part, we need the nxgdb developers to write better help information so that the model can accurately understand it. Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
Modify some memory classification and exclude the stack when drawing pie Signed-off-by: zhoupeng5 <zhoupeng5@xiaomi.com> | 2 个月前 | |
nxgdb: avoid using macro to speed up script loading Macro is used mainly to determine if some module is enabled or not. But it can be achieved by checking if corresponding symbol or type exists. This patch modifies most of the macro parsing to significantly improve script loading speed. Testing shows loading time is reduced from 10.8s to 2.4s for a 437MB elf, including GDB's startup time. The main methods are: 1. Check if some type exists: utils.lookup_type('some_type') is not None 2. Check if symbol exists: utils.get_static_symbol('symbol_name') 3. Check if struct field exists: utils.has_field('struct_name', 'field') 4. Use hardcoded constants for standard values (e.g., TCB flags, AF_INET) 5. Detect feature by checking source file names where functions are defined 6. Count struct field array items: utils.get_field_nitems() Key changes: - critmon.py: Check struct critmon_state_s existence - dmesg.py: Check for g_ramlog_channel_ops and g_rpmsg_channel_ops symbols - kasan.py: Detect kasan mode by source filename and type checking - mm.py: Use default alignment constant instead of config macro - net.py: Detect IPv4/IPv6 by checking struct fields, use standard AF_INET values - pm.py: Get PM_COUNT by counting wakelock array items - rpmsg.py: Check struct rpmsg_s existence - thread.py: Define all TCB flag constants, implement get_task_state_desc(), lazy-load registers, remove macro dictionary - utils.py: Simplify SMP detection, use constant for PID0_REPLACE - global.c: Add g_kasan_global_align const variable for debugging - Hardcode stack color to 0xdeadbeef for all arch, except avr Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
fix: wqueue tool miscalculates the kworker array address via kwork_wqueue_s Signed-off-by: ganjing <ganjing@xiaomi.com> | 2 个月前 | |
nxgdb: set trust read only on So GDB will load readonly data from elf directly, instead of gdbserver. It can also bypass the issue that some dump file includes wrong text section data Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
tools/gdb: Add ARM stack-based backtrace unwinder Add armspunwind.py module that provides stack-based backtrace unwinding for ARM architecture without relying on unwind tables. The code is originally from C code in arm_backtrace_sp.c. Key features: - Automatically detects code regions from GDB target sections - Analyzes BL/BLX branch instructions on stack to reconstruct calls - Supports both 16-bit BLX and 32-bit BL Thumb instructions - Provides armspbt GDB command for interactive stack unwinding - Works from TCB or explicit stack address ranges The unwinder scans stack memory looking for return addresses pointing to branch instructions, enabling backtrace reconstruction even when frame pointers or unwind information is unavailable. E.g. (gdb) bt #0 0x402a8902 in nxsem_wait_slow (sem=sem@entry=0x41d0fcd8 <g_lpwork+24>) at semaphore/sem_wait.c:237 #1 0x402ae3ac in nxsem_wait (sem=<optimized out>) at ../include/nuttx/semaphore.h:705 #2 nxsem_wait_uninterruptible (sem=<optimized out>) at ../include/nuttx/semaphore.h:1140 #3 work_thread (argc=<optimized out>, argv=<optimized out>) at wqueue/kwork_thread.c:322 #4 0x402abf0a in nxtask_start () at task/task_start.c:99 #5 0x00000000 in ?? () (gdb) armspbt Unwinding current task TCB: 0x4213ec68, lpwork Stack: 0x41d9f838 <g_lp_work_stack+176> - 0x41da0788 <g_hp_work_stack> 0x402a8b0c <nxsem_wait_slow+1004> /home/work/ssd1/workspace/Vela-specific product-dev-system-CI/nuttx/sched/./sched/sched.h:448 0x402ae3a8 <work_thread+168> /home/work/ssd1/workspace/Vela-specific product-dev-system-CI/nuttx/sched/../include/nuttx/semaphore.h:705 0x402abf08 <nxtask_start+120> /home/work/ssd1/workspace/Vela-specific product-dev-system-CI/nuttx/sched/task/task_start.c:99 Total frames: 3 (gdb) armspbt -s $sp -t 0x41da0788 0x402ae3a8 <work_thread+168> /home/work/ssd1/workspace/Vela-specific product-dev-system-CI/nuttx/sched/../include/nuttx/semaphore.h:705 0x402abf08 <nxtask_start+120> /home/work/ssd1/workspace/Vela-specific product-dev-system-CI/nuttx/sched/task/task_start.c:99 Total frames: 2 (gdb) Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
nxgdb: add completion for "target nxstub" command Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
nxgdb/mm: fix wrong macro parsed Use symbol instead of macro to parse CONFIG_MM_RECORD_STACK Move CONFIG_LIBC_BACKTRACE_DEPTH to backtrace.py Make utils.get_field_nitems always return int. Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
tools/nxgdbmcp: remove some legacy code nxgdbmcp contains some legacy code. This is because in its earliest design, nxgdbmcp had the ability to actively launch a GDB child process to hijack its stdio interaction, thus performing more complex actions. However, now it can only interact with GDB through gdbrpc, so some actions should be assumed to have been performed by the user. We found that adapting for each command results in significant token consumption for users. Firstly, the native command support for GDB can be removed. Secondly, regarding the nxgdb part, we need the nxgdb developers to write better help information so that the model can accurately understand it. Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
nxgdb: complete the option completion of other commands based on autocompletion In the completion of target nxstub, autocompletion is added to implement a universal completion solution for the option of any command. This commit is used to complete the option completion of other commands. Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
nxgdb: avoid using macro to speed up script loading Macro is used mainly to determine if some module is enabled or not. But it can be achieved by checking if corresponding symbol or type exists. This patch modifies most of the macro parsing to significantly improve script loading speed. Testing shows loading time is reduced from 10.8s to 2.4s for a 437MB elf, including GDB's startup time. The main methods are: 1. Check if some type exists: utils.lookup_type('some_type') is not None 2. Check if symbol exists: utils.get_static_symbol('symbol_name') 3. Check if struct field exists: utils.has_field('struct_name', 'field') 4. Use hardcoded constants for standard values (e.g., TCB flags, AF_INET) 5. Detect feature by checking source file names where functions are defined 6. Count struct field array items: utils.get_field_nitems() Key changes: - critmon.py: Check struct critmon_state_s existence - dmesg.py: Check for g_ramlog_channel_ops and g_rpmsg_channel_ops symbols - kasan.py: Detect kasan mode by source filename and type checking - mm.py: Use default alignment constant instead of config macro - net.py: Detect IPv4/IPv6 by checking struct fields, use standard AF_INET values - pm.py: Get PM_COUNT by counting wakelock array items - rpmsg.py: Check struct rpmsg_s existence - thread.py: Define all TCB flag constants, implement get_task_state_desc(), lazy-load registers, remove macro dictionary - utils.py: Simplify SMP detection, use constant for PID0_REPLACE - global.c: Add g_kasan_global_align const variable for debugging - Hardcode stack color to 0xdeadbeef for all arch, except avr Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
nxgdb: add new line to error message Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
nxgdb: complete the option completion of other commands based on autocompletion In the completion of target nxstub, autocompletion is added to implement a universal completion solution for the option of any command. This commit is used to complete the option completion of other commands. Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
tools/nxgdbmcp: remove some legacy code nxgdbmcp contains some legacy code. This is because in its earliest design, nxgdbmcp had the ability to actively launch a GDB child process to hijack its stdio interaction, thus performing more complex actions. However, now it can only interact with GDB through gdbrpc, so some actions should be assumed to have been performed by the user. We found that adapting for each command results in significant token consumption for users. Firstly, the native command support for GDB can be removed. Secondly, regarding the nxgdb part, we need the nxgdb developers to write better help information so that the model can accurately understand it. Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
tools/nxgdbmcp: remove some legacy code nxgdbmcp contains some legacy code. This is because in its earliest design, nxgdbmcp had the ability to actively launch a GDB child process to hijack its stdio interaction, thus performing more complex actions. However, now it can only interact with GDB through gdbrpc, so some actions should be assumed to have been performed by the user. We found that adapting for each command results in significant token consumption for users. Firstly, the native command support for GDB can be removed. Secondly, regarding the nxgdb part, we need the nxgdb developers to write better help information so that the model can accurately understand it. Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
tools/nxgdbmcp: remove some legacy code nxgdbmcp contains some legacy code. This is because in its earliest design, nxgdbmcp had the ability to actively launch a GDB child process to hijack its stdio interaction, thus performing more complex actions. However, now it can only interact with GDB through gdbrpc, so some actions should be assumed to have been performed by the user. We found that adapting for each command results in significant token consumption for users. Firstly, the native command support for GDB can be removed. Secondly, regarding the nxgdb part, we need the nxgdb developers to write better help information so that the model can accurately understand it. Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
pynuttx/gdbrpc: refactor to enable standalone package usage Refactor gdbrpc module to support independent usage as a pip package without requiring the entire pynuttx framework: Architecture changes: - Extract GDB command implementations from nxgdb/gdbrpc.py to gdbrpc/commands.py - Convert gdbrpc/__init__.py to auto-register commands on import - Simplify nxgdb/gdbrpc.py to a thin wrapper that adds autocompletion decorators Packaging improvements: - Fix package-dir in pyproject.toml: change from {"" = "."} to {"gdbrpc" = "."} - Add .gitignore for dist/ and *.egg-info/ directories - Enable proper pip installation as standalone package This allows users to 'pip install gdbrpc' and use it independently, while maintaining backward compatibility when loaded via nxgdb with enhanced autocompletion features. Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
nxgdb: add categroy field to diagnose output Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
tools/nxgdbmcp: remove some legacy code nxgdbmcp contains some legacy code. This is because in its earliest design, nxgdbmcp had the ability to actively launch a GDB child process to hijack its stdio interaction, thus performing more complex actions. However, now it can only interact with GDB through gdbrpc, so some actions should be assumed to have been performed by the user. We found that adapting for each command results in significant token consumption for users. Firstly, the native command support for GDB can be removed. Secondly, regarding the nxgdb part, we need the nxgdb developers to write better help information so that the model can accurately understand it. Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
nxgdb: avoid using macro to speed up script loading Macro is used mainly to determine if some module is enabled or not. But it can be achieved by checking if corresponding symbol or type exists. This patch modifies most of the macro parsing to significantly improve script loading speed. Testing shows loading time is reduced from 10.8s to 2.4s for a 437MB elf, including GDB's startup time. The main methods are: 1. Check if some type exists: utils.lookup_type('some_type') is not None 2. Check if symbol exists: utils.get_static_symbol('symbol_name') 3. Check if struct field exists: utils.has_field('struct_name', 'field') 4. Use hardcoded constants for standard values (e.g., TCB flags, AF_INET) 5. Detect feature by checking source file names where functions are defined 6. Count struct field array items: utils.get_field_nitems() Key changes: - critmon.py: Check struct critmon_state_s existence - dmesg.py: Check for g_ramlog_channel_ops and g_rpmsg_channel_ops symbols - kasan.py: Detect kasan mode by source filename and type checking - mm.py: Use default alignment constant instead of config macro - net.py: Detect IPv4/IPv6 by checking struct fields, use standard AF_INET values - pm.py: Get PM_COUNT by counting wakelock array items - rpmsg.py: Check struct rpmsg_s existence - thread.py: Define all TCB flag constants, implement get_task_state_desc(), lazy-load registers, remove macro dictionary - utils.py: Simplify SMP detection, use constant for PID0_REPLACE - global.c: Add g_kasan_global_align const variable for debugging - Hardcode stack color to 0xdeadbeef for all arch, except avr Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
tools/pynuttx: add cycle detection to list iterators Add cycle detection mechanism to NxList iterator to prevent infinite loops when traversing corrupted linked lists. When memory corruption causes a cycle in the list, the iterator now tracks visited node addresses and stops iteration with a warning message instead of hanging indefinitely. Changes: - Add _visited set to track traversed node addresses - Check for cycles in __next__ before processing each node - Print warning when cycle is detected and raise StopIteration This fix applies to NxList, NxSQueue, and NxDQueue through inheritance. E.g.: (gdb) wdog Warning: cycle detected in list at node 0x42034678 WDog@0x42034b38: tick: 3896988 0x40270a71 <nxsig_timeout> arg: 0x42034ae0 WDog@0x41d32658: tick: 3897074 0x40269a59 <nxsem_timeout> arg: 0x41d32600 Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
nxgdb: check if memory node's blink is valid Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
nxgdb: split the utils.py move Backtrace abd Addr2line from utils.py into spearate file Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
nxgdb/memdump: fix regular expression for byte sequence Use pythons' built-in bytes.find instead of re since the it treats value as string representation. This fixed the issue of memfind 0x3c452838 Searching for pattern b'3828453c' in memory Error: missing ), unterminated subpattern at position 1 Traceback (most recent call last): File "/home/neo/.local/lib/python3.10/site-packages/nxgdb/utils.py", line 361, in wrapper func(self, args, from_tty) File "/home/neo/.local/lib/python3.10/site-packages/nxgdb/memdump.py", line 1088, in invoke pattern = re.compile(re.escape(value)) File "/usr/lib/python3.10/re.py", line 251, in compile return _compile(pattern, flags) File "/usr/lib/python3.10/re.py", line 303, in _compile p = sre_compile.compile(pattern, flags) File "/usr/lib/python3.10/sre_compile.py", line 788, in compile p = sre_parse.parse(p, flags) File "/usr/lib/python3.10/sre_parse.py", line 955, in parse p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0) File "/usr/lib/python3.10/sre_parse.py", line 444, in _parse_sub itemsappend(_parse(source, state, verbose, nested + 1, File "/usr/lib/python3.10/sre_parse.py", line 843, in _parse raise source.error("missing ), unterminated subpattern", re.error: missing ), unterminated subpattern at position 1 Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
nxgdb: split the utils.py move Backtrace abd Addr2line from utils.py into spearate file Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
nxgdb/mm: merge overlapping memory regions Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
nxgdb: avoid using macro to speed up script loading Macro is used mainly to determine if some module is enabled or not. But it can be achieved by checking if corresponding symbol or type exists. This patch modifies most of the macro parsing to significantly improve script loading speed. Testing shows loading time is reduced from 10.8s to 2.4s for a 437MB elf, including GDB's startup time. The main methods are: 1. Check if some type exists: utils.lookup_type('some_type') is not None 2. Check if symbol exists: utils.get_static_symbol('symbol_name') 3. Check if struct field exists: utils.has_field('struct_name', 'field') 4. Use hardcoded constants for standard values (e.g., TCB flags, AF_INET) 5. Detect feature by checking source file names where functions are defined 6. Count struct field array items: utils.get_field_nitems() Key changes: - critmon.py: Check struct critmon_state_s existence - dmesg.py: Check for g_ramlog_channel_ops and g_rpmsg_channel_ops symbols - kasan.py: Detect kasan mode by source filename and type checking - mm.py: Use default alignment constant instead of config macro - net.py: Detect IPv4/IPv6 by checking struct fields, use standard AF_INET values - pm.py: Get PM_COUNT by counting wakelock array items - rpmsg.py: Check struct rpmsg_s existence - thread.py: Define all TCB flag constants, implement get_task_state_desc(), lazy-load registers, remove macro dictionary - utils.py: Simplify SMP detection, use constant for PID0_REPLACE - global.c: Add g_kasan_global_align const variable for debugging - Hardcode stack color to 0xdeadbeef for all arch, except avr Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
nxgdb/noteram: exit when failed to parse args Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
feat: enhance the output format for Notesnap Optimized output format: (gdb) notesnap +-----------+-----+------------+------+ | Task Name | PID | Note Type | Args | +-----------+-----+------------+------+ | Idle_Task | 0 | NOTE_START | 0x0 | | Idle_Task | 0 | NOTE_START | 0x0 | | Idle_Task | 0 | NOTE_START | 0x0 | | Idle_Task | 0 | NOTE_START | 0x0 | | Idle_Task | 0 | NOTE_START | 0x0 | | Idle_Task | 0 | NOTE_START | 0x0 | +-----------+-----+------------+------+ Signed-off-by: ganjing <ganjing@xiaomi.com> | 2 个月前 | |
nxgdb: Add string parsing mode to setregs command - Create parseregs.py with parse_registers() function to parse register values from string format (e.g., 'PC: 0x1234 SP: 5678') - Enhance setregs command with -s/--string flag to support parsing registers from string instead of loading from memory - Make colon separator optional to support space-separated format (e.g., 'PC 0x1234 SP 5678') in addition to colon format Usage: setregs -s "PC: 0x1234 SP 5678 LR: 0xABC" setregs tcb->xcp.regs Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
nxgdb: use utils.parse_and_eval() instead of gdb.parse_and_eval() GDB provides gdb.parse_and_eval() to get the value of a symbol, but its type is gdb.Value. It's impossible to use . to get the value of a member according to the type of the symbol itself. utils.parse_and_eval() is a wrapper of it, which can be easily evaluated. Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
nxgdb: avoid using macro to speed up script loading Macro is used mainly to determine if some module is enabled or not. But it can be achieved by checking if corresponding symbol or type exists. This patch modifies most of the macro parsing to significantly improve script loading speed. Testing shows loading time is reduced from 10.8s to 2.4s for a 437MB elf, including GDB's startup time. The main methods are: 1. Check if some type exists: utils.lookup_type('some_type') is not None 2. Check if symbol exists: utils.get_static_symbol('symbol_name') 3. Check if struct field exists: utils.has_field('struct_name', 'field') 4. Use hardcoded constants for standard values (e.g., TCB flags, AF_INET) 5. Detect feature by checking source file names where functions are defined 6. Count struct field array items: utils.get_field_nitems() Key changes: - critmon.py: Check struct critmon_state_s existence - dmesg.py: Check for g_ramlog_channel_ops and g_rpmsg_channel_ops symbols - kasan.py: Detect kasan mode by source filename and type checking - mm.py: Use default alignment constant instead of config macro - net.py: Detect IPv4/IPv6 by checking struct fields, use standard AF_INET values - pm.py: Get PM_COUNT by counting wakelock array items - rpmsg.py: Check struct rpmsg_s existence - thread.py: Define all TCB flag constants, implement get_task_state_desc(), lazy-load registers, remove macro dictionary - utils.py: Simplify SMP detection, use constant for PID0_REPLACE - global.c: Add g_kasan_global_align const variable for debugging - Hardcode stack color to 0xdeadbeef for all arch, except avr Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
tools/pynuttx: add gdbrpc library for remote GDB debugging Execute source /path/to/gdbinit.py and gdbrpc start to open a socket port for listening to commands. Then execute ./path/to/gdbrpc/__main__.py in another terminal to connect to corresponding port for debugging. Alternatively, you can write a Python script to establish a connection and serialize a callable object, the server will execute it. This process is mainly used in scenarios where other programs need to be involved in debugging, such as VTF or MCP. You can reference the examples to learn about it. Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
nxgdb: add viztracer to get python code trace Usage: viztracer COMMAND The output json file can be loaded to https://ui.perfetto.dev Or can be viewed locally via vizviewer result.json Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
nxgdb: split the utils.py move Backtrace abd Addr2line from utils.py into spearate file Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
nxgdb: avoid using macro to speed up script loading Macro is used mainly to determine if some module is enabled or not. But it can be achieved by checking if corresponding symbol or type exists. This patch modifies most of the macro parsing to significantly improve script loading speed. Testing shows loading time is reduced from 10.8s to 2.4s for a 437MB elf, including GDB's startup time. The main methods are: 1. Check if some type exists: utils.lookup_type('some_type') is not None 2. Check if symbol exists: utils.get_static_symbol('symbol_name') 3. Check if struct field exists: utils.has_field('struct_name', 'field') 4. Use hardcoded constants for standard values (e.g., TCB flags, AF_INET) 5. Detect feature by checking source file names where functions are defined 6. Count struct field array items: utils.get_field_nitems() Key changes: - critmon.py: Check struct critmon_state_s existence - dmesg.py: Check for g_ramlog_channel_ops and g_rpmsg_channel_ops symbols - kasan.py: Detect kasan mode by source filename and type checking - mm.py: Use default alignment constant instead of config macro - net.py: Detect IPv4/IPv6 by checking struct fields, use standard AF_INET values - pm.py: Get PM_COUNT by counting wakelock array items - rpmsg.py: Check struct rpmsg_s existence - thread.py: Define all TCB flag constants, implement get_task_state_desc(), lazy-load registers, remove macro dictionary - utils.py: Simplify SMP detection, use constant for PID0_REPLACE - global.c: Add g_kasan_global_align const variable for debugging - Hardcode stack color to 0xdeadbeef for all arch, except avr Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
rpmsgtrace2pcap.py:add gdb script to convert rpmsg trace info to pcap Signed-off-by: mazhuang <mazhuang@xiaomi.com> | 2 个月前 | |
nxgdb: avoid using macro to speed up script loading Macro is used mainly to determine if some module is enabled or not. But it can be achieved by checking if corresponding symbol or type exists. This patch modifies most of the macro parsing to significantly improve script loading speed. Testing shows loading time is reduced from 10.8s to 2.4s for a 437MB elf, including GDB's startup time. The main methods are: 1. Check if some type exists: utils.lookup_type('some_type') is not None 2. Check if symbol exists: utils.get_static_symbol('symbol_name') 3. Check if struct field exists: utils.has_field('struct_name', 'field') 4. Use hardcoded constants for standard values (e.g., TCB flags, AF_INET) 5. Detect feature by checking source file names where functions are defined 6. Count struct field array items: utils.get_field_nitems() Key changes: - critmon.py: Check struct critmon_state_s existence - dmesg.py: Check for g_ramlog_channel_ops and g_rpmsg_channel_ops symbols - kasan.py: Detect kasan mode by source filename and type checking - mm.py: Use default alignment constant instead of config macro - net.py: Detect IPv4/IPv6 by checking struct fields, use standard AF_INET values - pm.py: Get PM_COUNT by counting wakelock array items - rpmsg.py: Check struct rpmsg_s existence - thread.py: Define all TCB flag constants, implement get_task_state_desc(), lazy-load registers, remove macro dictionary - utils.py: Simplify SMP detection, use constant for PID0_REPLACE - global.c: Add g_kasan_global_align const variable for debugging - Hardcode stack color to 0xdeadbeef for all arch, except avr Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
nxgdb/target: fix misjudment of arch parameter When file name contains '-a', e.g. arm-v7a/nuttx, it's misjudged as arch parameter. Use ' -a ' instead can fix it. Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
tools/nxgdbmcp: remove some legacy code nxgdbmcp contains some legacy code. This is because in its earliest design, nxgdbmcp had the ability to actively launch a GDB child process to hijack its stdio interaction, thus performing more complex actions. However, now it can only interact with GDB through gdbrpc, so some actions should be assumed to have been performed by the user. We found that adapting for each command results in significant token consumption for users. Firstly, the native command support for GDB can be removed. Secondly, regarding the nxgdb part, we need the nxgdb developers to write better help information so that the model can accurately understand it. Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
nxgdb: complete the option completion of other commands based on autocompletion In the completion of target nxstub, autocompletion is added to implement a universal completion solution for the option of any command. This commit is used to complete the option completion of other commands. Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
tools/pynuttx: Refactor Tricore CSA dump command Add class TricoreCSA to represent one CSA. Use list(csa) can get all CSA in list. The CSA from TCB register context is special, since it points to the upper CSA now, and the lower CSA's address is above the tcb->xcp.regs with offset 0x40. csa_from_context is used to handle this case. Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
nxgdb/uname: parse symbol value instead of macro Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 | |
nxgdb: split fs.py into submodule Refactor fs into a submodule while preserving all functionality. Public APIs and classes are now auto-imported via __init__.py when using import nxgdb.fs. Internal APIs and classes should be imported via their full path, e.g., import nxgdb.fs.utils. Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
tools/nxgdbmcp: remove some legacy code nxgdbmcp contains some legacy code. This is because in its earliest design, nxgdbmcp had the ability to actively launch a GDB child process to hijack its stdio interaction, thus performing more complex actions. However, now it can only interact with GDB through gdbrpc, so some actions should be assumed to have been performed by the user. We found that adapting for each command results in significant token consumption for users. Firstly, the native command support for GDB can be removed. Secondly, regarding the nxgdb part, we need the nxgdb developers to write better help information so that the model can accurately understand it. Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
nxgdb/gdbvenv: fix the bug in pip cmd It's wrong to include '' in command args: pip_cmd: ['.gdbenv/bin/pip', 'install', '', 'lief'] ERROR: Invalid requirement: '' Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
nxgdb: add categroy field to diagnose output Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com> | 2 个月前 | |
nxgdb/wqueue: count running works to all works Previous: rpmsg-tee-0 (struct kwork_wqueue_s *)0x4185c810, running, 1 threads, 0 work Running: (struct kworker_s *)0x4185c868 (struct work_s *)0x41823ea0: 0x0 arg=0x41823ea0 Now: rpmsg-tee-0 (struct kwork_wqueue_s *)0x4185c810, running, 1 threads, 1 work Running: (struct kworker_s *)0x4185c868 (struct work_s *)0x41823ea0: 0x0 arg=0x41823ea0 Signed-off-by: xuxingliang <xuxingliang@xiaomi.com> | 2 个月前 |