This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 11/11 v5] Remove one GDBSERVER use from linux-waitpid.c
- From: Doug Evans <dje at google dot com>
- To: Gary Benson <gbenson at redhat dot com>
- Cc: gdb-patches at sourceware dot org, Pedro Alves <palves at redhat dot com>, Tom Tromey <tromey at redhat dot com>
- Date: Wed, 6 Aug 2014 11:35:11 -0700
- Subject: Re: [PATCH 11/11 v5] Remove one GDBSERVER use from linux-waitpid.c
- Authentication-results: sourceware.org; auth=none
- References: <1406888377-25795-1-git-send-email-gbenson at redhat dot com> <1406888377-25795-12-git-send-email-gbenson at redhat dot com>
Gary Benson writes:
> This commit makes nat/linux-waitpid.c include common-defs.h rather
> than defs.h or server.h. A use of GDBSERVER had to be left in to
> support some some thread_db debug code. This hack will be removed
> when the Linux thread_db code is unified and made shared.
>
> gdb/
> 2014-08-01 Gary Benson <gbenson@redhat.com>
>
> * nat/linux-waitpid.c: Include common-defs.h.
> Don't include defs.h or server.h.
> (linux_debug) [GDBSERVER]: Declare debug_threads.
> ---
> gdb/ChangeLog | 6 ++++++
> gdb/nat/linux-waitpid.c | 10 +++-------
> 2 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/gdb/nat/linux-waitpid.c b/gdb/nat/linux-waitpid.c
> index 53847ac..d04a3af 100644
> --- a/gdb/nat/linux-waitpid.c
> +++ b/gdb/nat/linux-waitpid.c
> @@ -17,13 +17,7 @@
> You should have received a copy of the GNU General Public License
> along with this program. If not, see <http://www.gnu.org/licenses/>. */
>
> -#ifdef GDBSERVER
> -#include "server.h"
> -#else
> -#include "defs.h"
> -#include "signal.h"
> -#endif
> -
> +#include "common-defs.h"
> #include "linux-nat.h"
> #include "linux-waitpid.h"
> #include "gdb_wait.h"
> @@ -35,6 +29,8 @@ static inline void
> linux_debug (const char *format, ...)
> {
> #ifdef GDBSERVER
> + extern int debug_threads;
> +
Recognizing that this is a temporary hack, ok by me.
Can I ask you to add a FIXME here though?
> if (debug_threads)
> {
> va_list args;
> --
> 1.7.1
>
--
/dje