#define GDBSERVER_DEBUG_H
#if !defined (IN_PROCESS_AGENT)
-extern int remote_debug;
+extern bool remote_debug;
+
+/* Print a "remote" debug statement. */
+
+#define remote_debug_printf(fmt, ...) \
+ debug_prefixed_printf_cond (remote_debug, \
+ "remote", fmt, ##__VA_ARGS__)
/* Switch all debug output to DEBUG_FILE. If DEBUG_FILE is nullptr or an
empty string, or if the file cannot be opened, then debug output is sent to
extern bool debug_threads;
+/* Print a "threads" debug statement. */
+
+#define threads_debug_printf(fmt, ...) \
+ debug_prefixed_printf_cond (debug_threads, \
+ "threads", fmt, ##__VA_ARGS__)
+
+/* Print "threads" enter/exit debug statements. */
+
+#define THREADS_SCOPED_DEBUG_ENTER_EXIT \
+ scoped_debug_enter_exit (debug_threads, "threads")
+
extern int debug_timestamp;
void debug_flush (void);
-void do_debug_enter (const char *function_name);
-void do_debug_exit (const char *function_name);
/* Async signal safe debug output function that calls write directly. */
ssize_t debug_write (const void *buf, size_t nbyte);
-/* These macros are for use in major functions that produce a lot of
- debugging output. They help identify in the mass of debugging output
- when these functions enter and exit. debug_enter is intended to be
- called at the start of a function, before any other debugging output.
- debug_exit is intended to be called at the end of the same function,
- after all debugging output. */
-#ifdef FUNCTION_NAME
-#define debug_enter() \
- do { do_debug_enter (FUNCTION_NAME); } while (0)
-#define debug_exit() \
- do { do_debug_exit (FUNCTION_NAME); } while (0)
-#else
-#define debug_enter() \
- do { } while (0)
-#define debug_exit() \
- do { } while (0)
-#endif
-
#endif /* GDBSERVER_DEBUG_H */