1 | @c |
---|
2 | @c COPYRIGHT (c) 1988-2002. |
---|
3 | @c On-Line Applications Research Corporation (OAR). |
---|
4 | @c All rights reserved. |
---|
5 | @c |
---|
6 | @c $Id$ |
---|
7 | @c |
---|
8 | |
---|
9 | @chapter Debug Session Example |
---|
10 | |
---|
11 | The following is a debug session. Note that some lines have been broken |
---|
12 | to aviod formatting problems in the printed document. |
---|
13 | |
---|
14 | @example |
---|
15 | GNU gdb 4.17 |
---|
16 | Copyright 1998 Free Software Foundation, Inc. |
---|
17 | GDB is free software, covered by the GNU General Public License, and |
---|
18 | you are welcome to change it and/or distribute copies of it under |
---|
19 | certain conditions. Type "show copying" to see the conditions. |
---|
20 | There is absolutely no warranty for GDB. |
---|
21 | Type "show warranty" for details. |
---|
22 | This GDB was configured as --host=i686-pc-linux-gnu --target=i386-rtems. |
---|
23 | (gdb) setrpcmode sun |
---|
24 | (gdb) setdaemontype rdbg |
---|
25 | (gdb) target rtems usnet-test |
---|
26 | Attaching remote machine across net... |
---|
27 | Connected to usnet-test. |
---|
28 | Now the "run" command will start a remote process. |
---|
29 | (gdb) file /buildr4/pc386/tests/debug.exe |
---|
30 | Reading symbols from /buildr4/pc386/tests/debug.exe...done. |
---|
31 | (gdb) attach 1 |
---|
32 | Attaching program: /buildr4/pc386/tests/debug.exe pid 1 |
---|
33 | 0x22fe65 in enterRdbg () |
---|
34 | (gdb) info threads |
---|
35 | There are 8 threads: |
---|
36 | Id. Name Detached Suspended |
---|
37 | 134283273 Rini No No <= current target thread |
---|
38 | 0x22fe65 in enterRdbg () |
---|
39 | 134283272 Evnt No No |
---|
40 | _Thread_Dispatch () at /rtems4/c/src/exec/score/src/thread.c:315 |
---|
41 | 134283271 SPE2 No No |
---|
42 | _Thread_Dispatch () at /rtems4/c/src/exec/score/src/thread.c:315 |
---|
43 | 134283270 SPE1 No No |
---|
44 | _Thread_Handler () at /rtems4/c/src/exec/score/src/thread.c:1107 |
---|
45 | 134283269 RDBG No No |
---|
46 | 0x22fe65 in enterRdbg () |
---|
47 | 134283268 SCrx No No |
---|
48 | _Thread_Dispatch () at /rtems4/c/src/exec/score/src/thread.c:315 |
---|
49 | 134283267 SCtx No No |
---|
50 | _Thread_Dispatch () at /rtems4/c/src/exec/score/src/thread.c:315 |
---|
51 | 134283266 ntwk No No |
---|
52 | _Thread_Dispatch () at /rtems4/c/src/exec/score/src/thread.c:315 |
---|
53 | (gdb) b init.c:92 |
---|
54 | Breakpoint 1 at 0x200180: file \ |
---|
55 | /rtems4/c/src/tests/samples/debug/init.c, line 92. |
---|
56 | (gdb) c |
---|
57 | Continuing. |
---|
58 | Thread 134283273 (Rini) has been deleted. |
---|
59 | [Switching to Rtems thread 134283271 (Not suspended) \ |
---|
60 | ( <= current target thread )] |
---|
61 | Breakpoint 1, example2 (argument=4) at \ |
---|
62 | /rtems4/c/src/tests/samples/debug/init.c:92 |
---|
63 | 92 tuto += tuti; |
---|
64 | (gdb) b init.c:66 |
---|
65 | Breakpoint 2 at 0x200128: file \ |
---|
66 | /rtems4/c/src/tests/samples/debug/init.c, line 66. |
---|
67 | (gdb) c |
---|
68 | Continuing. |
---|
69 | [Switching to Rtems thread 134283270 (Not suspended) \ |
---|
70 | ( <= current target thread )] |
---|
71 | Breakpoint 2, example1 (argument=4) at \ |
---|
72 | /rtems4/c/src/tests/samples/debug/init.c:66 |
---|
73 | 66 toto += titi; |
---|
74 | (gdb) c |
---|
75 | Continuing. |
---|
76 | [Switching to Rtems thread 134283271 (Not suspended) \ |
---|
77 | ( <= current target thread )] |
---|
78 | Breakpoint 1, example2 (argument=4) at \ |
---|
79 | /rtems4/c/src/tests/samples/debug/init.c:92 |
---|
80 | 92 tuto += tuti; |
---|
81 | (gdb) s |
---|
82 | 93 if (print_enable2) |
---|
83 | (gdb) detach |
---|
84 | Detaching program: /buildr4/pc386/tests/debug.exe pid 1 |
---|
85 | Warning: the next command will be done localy! |
---|
86 | If you want to restart another remote program, reuse the target command |
---|
87 | (gdb) quit |
---|
88 | @end example |
---|