File: README.dprintf

package info (click to toggle)
seergdb 2.6%2Bgit20251009%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,992 kB
  • sloc: cpp: 29,900; ansic: 1,432; python: 1,115; f90: 1,105; makefile: 761; asm: 244; objc: 165; ada: 102; cobol: 86; xml: 24; fortran: 12
file content (57 lines) | stat: -rw-r--r-- 1,929 bytes parent folder | download | duplicates (2)
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
57

-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)