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