From patchwork Fri Oct 5 03:42:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rashmica Gupta X-Patchwork-Id: 979268 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42RFwJ2wqrz9s8J for ; Fri, 5 Oct 2018 13:43:28 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="suBdnz9R"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42RFwJ0kDTzF3Fc for ; Fri, 5 Oct 2018 13:43:28 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="suBdnz9R"; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::52a; helo=mail-pg1-x52a.google.com; envelope-from=rashmica.g@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="suBdnz9R"; dkim-atps=neutral Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42RFw22prKzF3F5 for ; Fri, 5 Oct 2018 13:43:14 +1000 (AEST) Received: by mail-pg1-x52a.google.com with SMTP id n31-v6so4098689pgm.7 for ; Thu, 04 Oct 2018 20:43:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=p4koDO9OJbX8LhvCamknTy8Dxy31msLgtCRMG7MxIAs=; b=suBdnz9R/yXivGxzsfoPaGaWKR7o7Pgn/yQMHX1O0t5iU30MHEcHdAkn29FxYPGZ7/ 5PLH2XRw5HuxzWuvIY1ENZaKMfJMD2/+up/XksxGG3oCxSpMEYV3vfhij+i1W5JJv1jp UPn13hdTLGmstgNv0pEjlNIjQx4UYs26TelsMq3YHl8oO3KNlrtAXeNLPSAsRWzHPGSM gb3Vo0efIhMH+EGivcVU5qIwxt+hYeRyFN94jSQ0L/hNZjiMLeYBF43bZNtb5N3ffyOf CO68Tke4P7NotWv5vd8fqFMDTeKr75Nhs22XhXpUP4nutqB7E8rC0cFvLW9KxirHn/9F 2u8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=p4koDO9OJbX8LhvCamknTy8Dxy31msLgtCRMG7MxIAs=; b=THQ3snJNQqVrAsW1417zQ/k34WN/s2lvXh2uSK9H3YC/W16+7OX9eEgKEYTYCZsk5c bzOAdr2+jtqpyB/LulX4JW/6ZwqSIMxPBG8AgOIX5LmjlWW71Ti7PgIz2yw3hJPkg3Pi zyYeckvW6jyiENeYIDhyMQRhDU+sm+XewYGHinDkOsmX3IgbGC31vuvUfbulLDiDWWNn gF3vIQHSPvjppRHLtz8EA81c7z18jo1MuS+aULM/JiMArLMdvYbUKqHq/aH6MYWmYP35 lT+rzyfSgi2/dxE0HvQ6x8j13fnyngLhbqqD4P6MhKlr9fbCRVeqjLQ9fyZYw3WVxRHc 2d5Q== X-Gm-Message-State: ABuFfojHvGJX1UZAYiP/5xW0EK/4cwH1+RW3KJXgQU5Rr1ZYvcLuD7x+ 7CtYj+oPcSbnUPxA8TAbiUNZbp5CrQ8= X-Google-Smtp-Source: ACcGV62EbwC8fk8IRSwAtR57OidH2do4i3wmQ4uB+pfH9e6FPWn4Je31nyE+u7gGxi6ijjpqQZqNow== X-Received: by 2002:a63:2f42:: with SMTP id v63-v6mr8338124pgv.298.1538710992082; Thu, 04 Oct 2018 20:43:12 -0700 (PDT) Received: from rashmica.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id b62-v6sm9328180pfa.159.2018.10.04.20.43.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Oct 2018 20:43:11 -0700 (PDT) From: Rashmica Gupta To: pdbg@lists.ozlabs.org Date: Fri, 5 Oct 2018 13:42:53 +1000 Message-Id: <20181005034254.890-4-rashmica.g@gmail.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20181005034254.890-1-rashmica.g@gmail.com> References: <20181005034254.890-1-rashmica.g@gmail.com> Subject: [Pdbg] [PATCH v3 3/4] pdbg/gdbserver: Make gdbserver optional X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: npiggin@gmail.com MIME-Version: 1.0 Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Rashmica Gupta --- Makefile.am | 21 +++++++++++---------- configure.ac | 6 ++++++ src/pdbgproxy.c | 9 +++++++++ 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/Makefile.am b/Makefile.am index a476b87..581419c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -84,14 +84,17 @@ pdbg_SOURCES = \ src/parsers.c \ src/optcmd.c \ src/options_@ARCH@.c \ - src/htm.h \ - src/main.h \ - src/optcmd.h \ - src/options.h \ - src/parsers.h \ - src/progress.h \ - src/pdbgproxy.c \ - src/gdb_parser.c + src/pdbgproxy.c + +pdbg_CFLAGS = -I$(top_srcdir)/libpdbg -Wall -Werror -DGIT_SHA1=\"${GIT_SHA1}\" \ + $(ARCH_FLAGS) + +if GDBSERVER +pdbg_SOURCES += \ + $(extra_sources) +else +pdbg_CFLAGS += -DDISABLE_GDBSERVER +endif src/main.c: $(DT_headers) @@ -99,8 +102,6 @@ pdbg_LDADD = $(DT_objects) libpdbg.la libfdt.la libccan.a \ -L.libs -lrt pdbg_LDFLAGS = -Wl,--whole-archive,-lpdbg,--no-whole-archive -pdbg_CFLAGS = -I$(top_srcdir)/libpdbg -Wall -Werror -DGIT_SHA1=\"${GIT_SHA1}\" \ - $(ARCH_FLAGS) lib_LTLIBRARIES = libpdbg.la libfdt.la diff --git a/configure.ac b/configure.ac index 7cfd2ea..24440ac 100644 --- a/configure.ac +++ b/configure.ac @@ -36,4 +36,10 @@ AC_SUBST([ARCH]) AM_CONDITIONAL([TARGET_ARM], [test x"$ARCH" = "xarm"]) AM_CONDITIONAL([TARGET_PPC], [test x"$ARCH" = "xppc"]) +AC_ARG_ENABLE(gdbserver, +AC_HELP_STRING([--disable-gdbserver], [disables building the gdbserver]), +want_gdbserver=false, +want_gdbserver=true) +AM_CONDITIONAL([GDBSERVER], [test x$want_gdbserver = xtrue]) + AC_OUTPUT diff --git a/src/pdbgproxy.c b/src/pdbgproxy.c index 1ec66d6..3d1fdc7 100644 --- a/src/pdbgproxy.c +++ b/src/pdbgproxy.c @@ -25,6 +25,8 @@ #include "debug.h" #include "chip.h" +#ifndef DISABLE_GDBSERVER + /* Maximum packet size */ #define BUFFER_SIZE 8192 @@ -544,4 +546,11 @@ static int gdbserver(uint16_t port) gdbserver_start(target, port); return 0; } +#else + +static int gdbserver(uint16_t port) +{ + return 0; +} +#endif OPTCMD_DEFINE_CMD_WITH_ARGS(gdbserver, gdbserver, (DATA16));