From c1bc0935a4afb513486dc0a479cd57c0924b677c Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Fri, 12 Apr 2019 14:21:55 +0100 Subject: gdbserver: Move remote_debug to a single place A comment in debug.h (written in 2014) states: "We declare debug format variables here, and debug_threads but no other debug content variables (e.g., not remote_debug) because while this file is not currently used by IPA it may be some day, and IPA may have its own set of debug content variables". This has resulted in remote_debug being declared in many .c/.h files throughout gdbserver. It would be much simplier to define it one place. The most logical place to define it is in debug.h, surrounded by #define guards. If IPA is changed, then at that point the variable can be moved elsewhere. gdb/gdbserver/ChangeLog: * debug.c (remote_debug): Add definition. * debug.h (remote_debug): Add declaration. * hostio.c (remote_debug): Remove declaration. * remote-utils.c (struct ui_file): Likewise. (remote_debug): Likewise. * remote-utils.h (remote_debug): Likewise, * server.c (remote_debug): Remove definition. --- gdb/gdbserver/debug.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'gdb/gdbserver/debug.h') diff --git a/gdb/gdbserver/debug.h b/gdb/gdbserver/debug.h index e40f28c..c8d5e33 100644 --- a/gdb/gdbserver/debug.h +++ b/gdb/gdbserver/debug.h @@ -19,13 +19,10 @@ #ifndef GDBSERVER_DEBUG_H #define GDBSERVER_DEBUG_H -/* We declare debug format variables here, and debug_threads but no other - debug content variables (e.g., not remote_debug) because while this file - is not currently used by IPA it may be some day, and IPA may have its own - set of debug content variables. It's ok to declare debug_threads here - because it is misnamed - a better name is debug_basic or some such, - which can work for any program, gdbserver or IPA. If/when this file is - used with IPA it is recommended to fix debug_thread's name. */ +#if !defined (IN_PROCESS_AGENT) +extern int remote_debug; +#endif + extern int debug_threads; extern int debug_timestamp; -- cgit v1.1