Commit | Line | Data |
---|---|---|
87ce2a04 DE |
1 | /* Debugging routines for the remote server for GDB. |
2 | Copyright (C) 2014 Free Software Foundation, Inc. | |
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 | ||
19 | #ifndef DEBUG_H | |
20 | #define DEBUG_H | |
21 | ||
22 | /* We declare debug format variables here, and debug_threads but no other | |
23 | debug content variables (e.g., not remote_debug) because while this file | |
24 | is not currently used by IPA it may be some day, and IPA may have its own | |
25 | set of debug content variables. It's ok to declare debug_threads here | |
26 | because it is misnamed - a better name is debug_basic or some such, | |
27 | which can work for any program, gdbserver or IPA. If/when this file is | |
28 | used with IPA it is recommended to fix debug_thread's name. */ | |
29 | extern int debug_threads; | |
30 | extern int debug_timestamp; | |
31 | ||
32 | void debug_printf (const char *msg, ...) ATTRIBUTE_PRINTF (1, 2); | |
33 | void debug_flush (void); | |
34 | void do_debug_enter (const char *function_name); | |
35 | void do_debug_exit (const char *function_name); | |
36 | ||
37 | /* These macros are for use in major functions that produce a lot of | |
38 | debugging output. They help identify in the mass of debugging output | |
39 | when these functions enter and exit. debug_enter is intended to be | |
40 | called at the start of a function, before any other debugging output. | |
41 | debug_exit is intended to be called at the end of the same function, | |
42 | after all debugging output. */ | |
43 | #ifdef FUNCTION_NAME | |
44 | #define debug_enter() \ | |
45 | do { do_debug_enter (FUNCTION_NAME); } while (0) | |
46 | #define debug_exit() \ | |
47 | do { do_debug_exit (FUNCTION_NAME); } while (0) | |
48 | #else | |
49 | #define debug_enter() \ | |
50 | do { } while (0) | |
51 | #define debug_exit() \ | |
52 | do { } while (0) | |
53 | #endif | |
54 | ||
55 | #endif /* DEBUG_H */ |