| 211 | * GDB 線上除錯練習 |
| 212 | {{{ |
| 213 | [tty1] |
| 214 | |
| 215 | root@etch:~# apt-get build-dep jfbterm |
| 216 | root@etch:~# apt-get source jfbterm |
| 217 | root@etch:~# apt-get install jfbterm |
| 218 | root@etch:~# cd jfbterm-0.4.7 |
| 219 | root@etch:~/jfbterm-0.4.7# ./configure --enable-debug |
| 220 | root@etch:~/jfbterm-0.4.7# make |
| 221 | root@etch:~/jfbterm-0.4.7# ./jfbterm -f /etc/jfbterm.conf -e /root/test.sh |
| 222 | |
| 223 | [tty2] |
| 224 | |
| 225 | root@etch:~# gdb /root/jfbterm-0.4.7/jfbterm `pidof jfbterm` |
| 226 | GNU gdb 6.4.90-debian |
| 227 | Copyright (C) 2006 Free Software Foundation, Inc. |
| 228 | GDB is free software, covered by the GNU General Public License, and you are |
| 229 | welcome to change it and/or distribute copies of it under certain conditions. |
| 230 | Type "show copying" to see the conditions. |
| 231 | There is absolutely no warranty for GDB. Type "show warranty" for details. |
| 232 | This GDB was configured as "i486-linux-gnu"...Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". |
| 233 | |
| 234 | Attaching to program: /root/jfbterm-0.4.7/jfbterm, process 7480 |
| 235 | Reading symbols from /lib/tls/i686/cmov/libutil.so.1...done. |
| 236 | Loaded symbols for /lib/tls/i686/cmov/libutil.so.1 |
| 237 | Reading symbols from /lib/tls/i686/cmov/libm.so.6...done. |
| 238 | Loaded symbols for /lib/tls/i686/cmov/libm.so.6 |
| 239 | Reading symbols from /lib/tls/i686/cmov/libc.so.6...done. |
| 240 | Loaded symbols for /lib/tls/i686/cmov/libc.so.6 |
| 241 | Reading symbols from /lib/ld-linux.so.2...done. |
| 242 | Loaded symbols for /lib/ld-linux.so.2 |
| 243 | Reading symbols from /lib/tls/i686/cmov/libnss_compat.so.2...done. |
| 244 | Loaded symbols for /lib/tls/i686/cmov/libnss_compat.so.2 |
| 245 | Reading symbols from /lib/tls/i686/cmov/libnsl.so.1...done. |
| 246 | Loaded symbols for /lib/tls/i686/cmov/libnsl.so.1 |
| 247 | Reading symbols from /lib/tls/i686/cmov/libnss_nis.so.2...done. |
| 248 | Loaded symbols for /lib/tls/i686/cmov/libnss_nis.so.2 |
| 249 | Reading symbols from /lib/tls/i686/cmov/libnss_files.so.2...done. |
| 250 | Loaded symbols for /lib/tls/i686/cmov/libnss_files.so.2 |
| 251 | Failed to read a valid object file image from memory. |
| 252 | 0xb7fea410 in ?? () |
| 253 | (gdb) break term.c:284 |
| 254 | Breakpoint 1 at 0x804f552: file term.c, line 284. |
| 255 | (gdb) c |
| 256 | Continuing. |
| 257 | |
| 258 | Breakpoint 1, tterm_final (p=0x8058be0) at term.c:284 |
| 259 | 284 time(&(utp->ut_time)); |
| 260 | (gdb) c |
| 261 | Continuing. |
| 262 | |
| 263 | Breakpoint 1, tterm_final (p=0x8058be0) at term.c:284 |
| 264 | 284 time(&(utp->ut_time)); |
| 265 | (gdb) c |
| 266 | Continuing. |
| 267 | |
| 268 | Program exited normally. |
| 269 | }}} |
| 270 | * GDB 遠端除錯練習 |
| 271 | {{{ |
| 272 | |
| 273 | }}} |