[gdb] Fix build breaker with gcc 4.8
[deliverable/binutils-gdb.git] / gdb / gdbserver / debug.h
CommitLineData
87ce2a04 1/* Debugging routines for the remote server for GDB.
42a4f53d 2 Copyright (C) 2014-2019 Free Software Foundation, Inc.
87ce2a04
DE
3
4 This file is part of GDB.
5
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.
10
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.
15
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/>. */
18
1a5c2598
TT
19#ifndef GDBSERVER_DEBUG_H
20#define GDBSERVER_DEBUG_H
87ce2a04 21
c1bc0935
AH
22#if !defined (IN_PROCESS_AGENT)
23extern int remote_debug;
aeb2e706
AH
24
25/* Switch all debug output to DEBUG_FILE. If DEBUG_FILE is nullptr or an
26 empty string, or if the file cannot be opened, then debug output is sent to
27 stderr. */
28void debug_set_output (const char *debug_file);
c1bc0935
AH
29#endif
30
87ce2a04
DE
31extern int debug_threads;
32extern int debug_timestamp;
33
87ce2a04
DE
34void debug_flush (void);
35void do_debug_enter (const char *function_name);
36void do_debug_exit (const char *function_name);
37
a7e559cc
AH
38/* Async signal safe debug output function that calls write directly. */
39size_t debug_write (const void *buf, size_t nbyte);
40
87ce2a04
DE
41/* These macros are for use in major functions that produce a lot of
42 debugging output. They help identify in the mass of debugging output
43 when these functions enter and exit. debug_enter is intended to be
44 called at the start of a function, before any other debugging output.
45 debug_exit is intended to be called at the end of the same function,
46 after all debugging output. */
47#ifdef FUNCTION_NAME
48#define debug_enter() \
49 do { do_debug_enter (FUNCTION_NAME); } while (0)
50#define debug_exit() \
51 do { do_debug_exit (FUNCTION_NAME); } while (0)
52#else
53#define debug_enter() \
54 do { } while (0)
55#define debug_exit() \
56 do { } while (0)
57#endif
58
1a5c2598 59#endif /* GDBSERVER_DEBUG_H */
This page took 0.441508 seconds and 4 git commands to generate.