Fix regeneration of ld configure and makefiles
[binutils-gdb.git] / gdbserver / debug.h
blobd924275210996e5e9b82ef895e359f4d9dc06e67
1 /* Debugging routines for the remote server for GDB.
2 Copyright (C) 2014-2022 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 /* Print a "remote" debug statement. */
27 #define remote_debug_printf(fmt, ...) \
28 debug_prefixed_printf_cond (remote_debug, \
29 "remote", fmt, ##__VA_ARGS__)
31 /* Switch all debug output to DEBUG_FILE. If DEBUG_FILE is nullptr or an
32 empty string, or if the file cannot be opened, then debug output is sent to
33 stderr. */
34 void debug_set_output (const char *debug_file);
35 #endif
37 extern int using_threads;
39 /* Enable miscellaneous debugging output. The name is historical - it
40 was originally used to debug LinuxThreads support. */
42 extern bool debug_threads;
44 /* Print a "threads" debug statement. */
46 #define threads_debug_printf(fmt, ...) \
47 debug_prefixed_printf_cond (debug_threads, \
48 "threads", fmt, ##__VA_ARGS__)
50 /* Print "threads" enter/exit debug statements. */
52 #define THREADS_SCOPED_DEBUG_ENTER_EXIT \
53 scoped_debug_enter_exit (debug_threads, "threads")
55 extern int debug_timestamp;
57 void debug_flush (void);
59 /* Async signal safe debug output function that calls write directly. */
60 ssize_t debug_write (const void *buf, size_t nbyte);
62 #endif /* GDBSERVER_DEBUG_H */