forked from epasveer/seer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.dprintf
57 lines (39 loc) · 1.88 KB
/
README.dprintf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
-dprintf-insert [ -t ] [ -f ] [ -d ] [ --qualified ]
[ -c condition ] [--force-condition] [ -i ignore-count ]
[ -p thread-id ] [ location ] [ format ]
[ argument ]
-break-insert [ -t ] [ -h ] [ -f ] [ -d ] [ -a ] [ --qualified ]
[ -c condition ] [ --force-condition ] [ -i ignore-count ]
[ -p thread-id ] [ location ]
-h = hardware breakpoint (not supported in dprintf)
-a = create a tracepoint (not supported in dprintf)
If supplied, location and --qualified may be specified the same way as for the -break-insert command. See -break-insert.
The possible optional parameters of this command are:
‘-t’
Insert a temporary breakpoint.
‘-f’
If location cannot be parsed (for example, if it refers to unknown files or functions), create a pending breakpoint. Without this flag,
GDB will report an error, and won’t create a breakpoint, if location cannot be parsed.
‘-d’
Create a disabled breakpoint.
‘-c condition’
Make the breakpoint conditional on condition.
‘--force-condition’
Forcibly define the breakpoint even if the condition is invalid at all of the breakpoint locations.
‘-i ignore-count’
Set the ignore count of the breakpoint (see ignore count) to ignore-count.
‘-p thread-id’
Restrict the breakpoint to the thread with the specified global thread-id.
Output to a log file.
--------------------
As an example, if you wanted dprintf output to go to a logfile that is a standard I/O stream assigned to the variable mylog, you could do the following:
(gdb) set dprintf-style call
(gdb) set dprintf-function fprintf
(gdb) set dprintf-channel mylog
(gdb) dprintf 25,"at line 25, glob=%d\n",glob
Dprintf 1 at 0x123456: file main.c, line 25.
(gdb) info break
1 dprintf keep y 0x00123456 in main at main.c:25
call (void) fprintf (mylog,"at line 25, glob=%d\n",glob)
continue
(gdb)