Commit af559a8
tools/nuttx-gdbinit: improve experience of gdb backend scripts
Redefine built-in command (info thread/thread/c) to compatible with developer habits
Test board:
./tools/configure.sh -E lm3s6965-ek:qemu-flat
1. start qemu:
qemu-system-arm -M lm3s6965evb -device loader,file=nuttx -serial mon:stdio -nographic -s
2. gdb attach:
gdb-multiarch -ix tools/nuttx-gdbinit nuttx -ex "target extended-remote localhost:1234"
3. show thread info and callstack:
| (gdb) info thread
| * 0 Thread 0x20001548 (Name: Idle Task, State: Running, Priority: 0, Stack: 1000) PC: 0x9eee in up_idle()
| 1 Thread 0x20005058 (Name: hpwork, State: Waiting,Semaphore, Priority: 224, Stack: 1992) PC: 0xa124 in up_switch_context()
| 2 Thread 0x20005c20 (Name: nsh_main, State: Waiting,Semaphore, Priority: 100, Stack: 2000) PC: 0xa124 in up_switch_context()
| 3 Thread 0x20006b30 (Name: NTP daemon, State: Waiting,Semaphore, Priority: 100, Stack: 1952) PC: 0xa124 in up_switch_context()
| 4 Thread 0x200086f0 (Name: telnetd, State: Waiting,Semaphore, Priority: 100, Stack: 2008) PC: 0xa124 in up_switch_context()
| (gdb) bt
| #0 0x00009eee in up_idle () at chip/common/tiva_idle.c:62
| #1 0x00003dd2 in nx_start () at init/nx_start.c:698
| #2 0x00000190 in __start () at chip/common/lmxx_tm4c_start.c:177
| (gdb) thread 4
| 4 Thread 0x200086f0 (Name: telnetd, State: Waiting,Semaphore, Priority: 100, Stack: 2008) PC: 0xa124 in up_switch_context()
| (gdb) bt
| #0 up_switch_context (tcb=0x20001548 <g_idletcb>, rtcb=rtcb@entry=0x200086f0) at common/arm_switchcontext.c:95
| #1 0x0000453a in nxsem_wait (sem=sem@entry=0x2000916c) at semaphore/sem_wait.c:176
| #2 0x0000197e in _net_timedwait (sem=sem@entry=0x2000916c, interruptible=interruptible@entry=true, timeout=timeout@entry=4294967295) at utils/net_lock.c:101
| apache#3 0x0000198e in net_sem_timedwait (sem=sem@entry=0x2000916c, timeout=timeout@entry=4294967295) at utils/net_lock.c:242
| apache#4 0x00001996 in net_sem_wait (sem=sem@entry=0x2000916c) at utils/net_lock.c:330
| apache#5 0x00025f84 in psock_tcp_accept (psock=<optimized out>, addr=<optimized out>, addrlen=<optimized out>, newconn=newconn@entry=0x2000956c) at tcp/tcp_accept.c:274
| apache#6 0x00025432 in inet_accept (psock=<optimized out>, addr=<optimized out>, addrlen=<optimized out>, newsock=0x20009568, flags=0) at inet/inet_sockif.c:1443
| apache#7 0x00027a10 in psock_accept (psock=0x200044b8, addr=addr@entry=0x2000921c, addrlen=addrlen@entry=0x2000920c, newsock=newsock@entry=0x20009568, flags=flags@entry=0) at socket/accept.c:149
| apache#8 0x00027a8c in accept4 (sockfd=sockfd@entry=3, addr=addr@entry=0x2000921c, addrlen=addrlen@entry=0x2000920c, flags=flags@entry=0) at socket/accept.c:280
| apache#9 0x0002a256 in accept (sockfd=sockfd@entry=3, addr=addr@entry=0x2000921c, addrlen=addrlen@entry=0x2000920c) at net/lib_accept.c:50
| apache#10 0x0001efaa in telnetd_daemon (config=config@entry=0x20009290) at telnetd_daemon.c:200
| apache#11 0x0001e508 in telnetd_main (argc=1, argv=0x20008af8) at telnetd.c:98
| apache#12 0x00008486 in nxtask_startup (entrypt=0x1e4bd <telnetd_main>, entrypt@entry=0x1 <up_putc>, argc=1, argv=0x20008af8) at sched/task_startup.c:70
| apache#13 0x000056d2 in nxtask_start () at task/task_start.c:134
| apache#14 0x00000000 in ?? ()
| (gdb) c
Signed-off-by: chao an <[email protected]>1 parent 0460165 commit af559a8
1 file changed
+37
-40
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | 81 | | |
92 | 82 | | |
93 | 83 | | |
94 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
95 | 93 | | |
96 | 94 | | |
| 95 | + | |
97 | 96 | | |
98 | | - | |
| 97 | + | |
99 | 98 | | |
100 | 99 | | |
101 | 100 | | |
| |||
137 | 136 | | |
138 | 137 | | |
139 | 138 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
150 | 142 | | |
151 | 143 | | |
152 | 144 | | |
153 | 145 | | |
154 | | - | |
155 | 146 | | |
156 | 147 | | |
157 | 148 | | |
| |||
406 | 397 | | |
407 | 398 | | |
408 | 399 | | |
409 | | - | |
410 | | - | |
411 | | - | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
412 | 403 | | |
413 | 404 | | |
414 | 405 | | |
415 | 406 | | |
416 | | - | |
417 | | - | |
418 | | - | |
| 407 | + | |
419 | 408 | | |
420 | 409 | | |
| 410 | + | |
421 | 411 | | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | 412 | | |
426 | 413 | | |
427 | | - | |
428 | | - | |
| 414 | + | |
| 415 | + | |
429 | 416 | | |
430 | 417 | | |
431 | 418 | | |
432 | | - | |
433 | 419 | | |
434 | 420 | | |
435 | 421 | | |
436 | 422 | | |
437 | 423 | | |
438 | | - | |
| 424 | + | |
439 | 425 | | |
440 | 426 | | |
441 | 427 | | |
442 | 428 | | |
443 | 429 | | |
444 | 430 | | |
445 | 431 | | |
446 | | - | |
| 432 | + | |
447 | 433 | | |
448 | 434 | | |
449 | | - | |
| 435 | + | |
450 | 436 | | |
451 | 437 | | |
452 | 438 | | |
453 | 439 | | |
454 | 440 | | |
455 | 441 | | |
456 | 442 | | |
457 | | - | |
458 | | - | |
| 443 | + | |
459 | 444 | | |
460 | 445 | | |
461 | 446 | | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
0 commit comments