-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nuttxgdb utils module update #14912
nuttxgdb utils module update #14912
Commits on Nov 23, 2024
-
gdb/macro: fix cached macro info is outdated
Use the file hash instead to avoid file name conflicts Signed-off-by: xuxingliang <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b40b07b - Browse repository at this point
Copy the full SHA b40b07bView commit details -
tools/gdb: fix elf file with special character
Make sure file name is surrounded by \" Signed-off-by: xuxingliang <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ee82d46 - Browse repository at this point
Copy the full SHA ee82d46View commit details -
gdb/macro: cache macro info to json and load directly
Use json module to save macro info to json file and load directly. It can save 2seconds for x4b projects to load plugin Signed-off-by: xuxingliang <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 390d48e - Browse repository at this point
Copy the full SHA 390d48eView commit details -
nuttxgdb: fix container_of pointer offset calc problem
Signed-off-by: buxiasen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 21defc8 - Browse repository at this point
Copy the full SHA 21defc8View commit details -
tools/gdb: Allow utils.container_of with str input
After we introduced NxDQueue and NxSQueue, we're using them like `NxDQueue(g_active_connections, "struct socket_conn_s", "node")` and leads to `utils.container_of(ptr, str, str)`, so maybe we need to allow str input for `utils.container_of` Signed-off-by: Zhe Weng <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6f355f9 - Browse repository at this point
Copy the full SHA 6f355f9View commit details -
tools/gdb: Use ptr's value instead of ptr's adderess in container_of
We're using `ptr.cast(get_long_type())` a week ago to get the pointer's value, it's alright, but `ptr.address` is not, the `ptr.address` will return **the address of the pointer**. These values are the address of first element in the queue: - `int(g_sigfreeaction["head"])` - `g_sigfreeaction["head"].cast(get_long_type())` - `g_sigfreeaction["head"].dereference().address` But: `int(g_sigfreeaction["head"].address)` is the address of the "head" member, which equals to the address of `g_sigfreeaction` It's happening in NxSQueue: g_sigfreeaction = gdb.parse_and_eval("g_sigfreeaction") print(["%x" % (node) for node in NxSQueue(g_sigfreeaction)]) print(["%x" % (node) for node in NxSQueue(g_sigfreeaction, "sigactq_t", "flink")]) Without this patch: ['f3c0aa10', 'f3c0aa2c', 'f3c0aa48'] ['55db90a0', 'f3c0aa10', 'f3c0aa2c'] With this patch: ['f3c0aa10', 'f3c0aa2c', 'f3c0aa48'] ['f3c0aa10', 'f3c0aa2c', 'f3c0aa48'] Signed-off-by: Zhe Weng <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b89d64e - Browse repository at this point
Copy the full SHA b89d64eView commit details -
Use array iterator where possible. Signed-off-by: xuxingliang <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b4784d1 - Browse repository at this point
Copy the full SHA b4784d1View commit details -
tools/gdb: add utils.get_tid(tcb)
Signed-off-by: huangyin5 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 63f8683 - Browse repository at this point
Copy the full SHA 63f8683View commit details -
tools/gdb: decode backtrace of crashlog
Now crash log can be directly pass to addr2line tool to get all backtraces. E.g. (gdb) addr2line -f crash.log -p 485 Address Symbol Source Backtrace of 485 0x402cc0ac <up_switch_context+84> /home/work/ssd1/workspace/MiRTOS-X4b-Stable-Build/nuttx/include/arch/syscall.h:179 0x40291276 <nxsig_timedwait+386> signal/sig_timedwait.c:365 0x4028fc7e <nxsig_nanosleep+106> signal/sig_nanosleep.c:141 0x4028fdba <clock_nanosleep+26> signal/sig_nanosleep.c:333 0x402c3736 <usleep+62> unistd/lib_usleep.c:108 0x415018c0 <cs2p2p_mSecSleep+24> Src/PPPP_Common.c:1139 0x414fabde <cs2p2p_Run_send_DRW+258> Src/PPPP_API.c:5577 0x414fac62 <cs2p2p_PPPP_thread_send_DRW+18> Src/PPPP_API.c:5616 0x40446f62 <pthread_startup+10> pthread/pthread_create.c:59 0x41094f4a <pthread_start+106> pthread/pthread_create.c:139 Signed-off-by: xuxingliang <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for df822c7 - Browse repository at this point
Copy the full SHA df822c7View commit details -
tools/gdb: support string type in offset_of
1. Support any type of value as pointer address in container_of 2. Support string as type in offset_of 3. Make sure type is a pointer in container_of, and not a pointer in offset_of Signed-off-by: xuxingliang <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cb8a737 - Browse repository at this point
Copy the full SHA cb8a737View commit details -
nuttxgdb/utils.py:add ArrayIterator reverse iterate.
Signed-off-by: yangao1 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d13931f - Browse repository at this point
Copy the full SHA d13931fView commit details -
tools/gdb: fix hexdump expression parse
Signed-off-by: xuxingliang <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bfd8e67 - Browse repository at this point
Copy the full SHA bfd8e67View commit details -
tools/gdb: add function to convert C enum to python Enum class
Usage: (gdb) py NX_INITSTATE = utils.enum("enum nx_initstate_e") (gdb) py print(list(NX_INITSTATE)) [<NX_INITSTATE_E.POWERUP: 0>, <NX_INITSTATE_E.BOOT: 1>, <NX_INITSTATE_E.TASKLISTS: 2>, <NX_INITSTATE_E.MEMORY: 3>, <NX_INITSTATE_E.HARDWARE: 4>, <NX_INITSTATE_E.OSREADY: 5>, <NX_INITSTATE_E.IDLELOOP: 6>, <NX_INITSTATE_E.PANIC: 7>] (gdb) py print(NX_INITSTATE.POWERUP) NX_INITSTATE_E.POWERUP (gdb) py print(NX_INITSTATE.POWERUP.value) 0 (gdb) py print(NX_INITSTATE(1)) Signed-off-by: xuxingliang <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0947bc6 - Browse repository at this point
Copy the full SHA 0947bc6View commit details -
Configuration menu - View commit details
-
Copy full SHA for b6b9ae5 - Browse repository at this point
Copy the full SHA b6b9ae5View commit details -
gdb: move profiling commands to profile.py
Add simple time command to test time cost of a command. Usage: (gdb) time memleak ... (gdb) Time elapsed: 1.23456s Signed-off-by: xuxingliang <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f2bab72 - Browse repository at this point
Copy the full SHA f2bab72View commit details -
gdb/register: register name sp, pc are always available
GDB provides four “standard” register names sp, pc, fp and ps. Those can be used in most of the cases. See https://sourceware.org/gdb/current/onlinedocs/gdb.html/Registers.html Signed-off-by: xuxingliang <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a3ba96e - Browse repository at this point
Copy the full SHA a3ba96eView commit details -
gdb/backtrace: optimize backtrace formatting
Use a class Bactrace to support convert address to backtrace, format to string, accessing element and iterate though them. Adjust usage in fs and addr2line to make full use of it. Signed-off-by: xuxingliang <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 15a9d53 - Browse repository at this point
Copy the full SHA 15a9d53View commit details -
gdb/utils: cache backtrace result for better performance
GDB is slow to look up symbols, cache the result to speed up commands like memdump etc. Signed-off-by: xuxingliang <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 86d7419 - Browse repository at this point
Copy the full SHA 86d7419View commit details -
tools/gdb: improve nxgcore speed
Let GDB to read from ELF for readonly data. Disable this feature by nxgcore --no-trust-readonly. Signed-off-by: xuxingliang <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 41c88d9 - Browse repository at this point
Copy the full SHA 41c88d9View commit details