Files
seer/notes/README.dprintf
Ernie Pasveer 58543b33e7 Finished Printpoints for now.
They always go to printf(). So the go to the console.
In the future, I can add an option to go to the "GDB output" tab.

Also, it may be possible to have a "Printpoint output" tab.
If the format has some magic text, the handleText() mechanism
may be able to intercept the output. For example, if the format
is:

    "^PrintPointFormat %d %d\n"

Of course this would work only if dprintf uses printf().
2022-01-29 17:16:12 -06:00

58 lines
1.9 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-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 wont 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)