Add translations for various sub-directories
[binutils-gdb.git] / gdbserver / debug.h
blobeb6f69549aedd2094d445203a58610b6d26e6fa2
1 /* Debugging routines for the remote server for GDB.
2 Copyright (C) 2014-2024 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 #ifndef GDBSERVER_DEBUG_H
20 #define GDBSERVER_DEBUG_H
22 #if !defined (IN_PROCESS_AGENT)
23 extern bool remote_debug;
25 /* If true, do not print the packet content sent with the next putpkt.
26 This flag is reset to false after each putpkt logging. Useful to
27 omit printing binary packet contents. */
28 extern bool suppressed_remote_debug;
30 /* Print a "remote" debug statement. */
32 #define remote_debug_printf(fmt, ...) \
33 debug_prefixed_printf_cond (remote_debug, \
34 "remote", fmt, ##__VA_ARGS__)
36 /* Switch all debug output to DEBUG_FILE. If DEBUG_FILE is nullptr or an
37 empty string, or if the file cannot be opened, then debug output is sent to
38 stderr. */
39 void debug_set_output (const char *debug_file);
40 #endif
42 extern int using_threads;
44 /* Enable miscellaneous debugging output. The name is historical - it
45 was originally used to debug LinuxThreads support. */
47 extern bool debug_threads;
49 /* Print a "threads" debug statement. */
51 #define threads_debug_printf(fmt, ...) \
52 debug_prefixed_printf_cond (debug_threads, \
53 "threads", fmt, ##__VA_ARGS__)
55 /* Print "threads" enter/exit debug statements. */
57 #define THREADS_SCOPED_DEBUG_ENTER_EXIT \
58 scoped_debug_enter_exit (debug_threads, "threads")
60 extern int debug_timestamp;
62 void debug_flush (void);
64 /* Async signal safe debug output function that calls write directly. */
65 ssize_t debug_write (const void *buf, size_t nbyte);
67 /* Suppress the next putpkt debug log by omitting the packet contents.
68 Useful to reduce the logs when sending binary packets. */
70 void suppress_next_putpkt_log ();
72 #endif /* GDBSERVER_DEBUG_H */