From patchwork Fri Nov 2 00:46:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rashmica Gupta X-Patchwork-Id: 992159 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42mNhY0hbqz9sML for ; Fri, 2 Nov 2018 11:47:41 +1100 (AEDT) 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="LYt9pB8V"; 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 42mNhX5tz9zF31F for ; Fri, 2 Nov 2018 11:47:40 +1100 (AEDT) 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="LYt9pB8V"; 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::642; helo=mail-pl1-x642.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="LYt9pB8V"; dkim-atps=neutral Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) (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 42mNgy0rQSzDrJs for ; Fri, 2 Nov 2018 11:47:10 +1100 (AEDT) Received: by mail-pl1-x642.google.com with SMTP id g59-v6so150707plb.10 for ; Thu, 01 Nov 2018 17:47:10 -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=bXi4JWXynpOgoFVAFsaYBvnZzfui1cf1QOV4I6dEi7I=; b=LYt9pB8V4Eoh4q2VdGiX0U0ruOkGcjxm+drE63gEpNV8slFisXVST7JzE0uv3V6lPE mnsZJO7/MGZzTDe1Z3kdKy8/VcYKDAnc7XtL/iFitJe4wmjJx53rBwTFL7zg4919aOF/ NoeMLB4qCyVJbsxShfY2j93N8TEwX/sDEpFimtmuF1krZjmQ5thGNoBJ5u3I2rUPwpza y756NOh49YHES8SHX8yM8R2WdUioe4HUyAz0dnpZhNrY2ScZ0cBKD0J3DsSE3ROPWj5E p9TNVZfM69E+GsxK/gI3bOl7VfYvpYs280YFxo+HrMLhZAHY7v0zR6SbYlr4SBlXA8/0 Bydg== 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=bXi4JWXynpOgoFVAFsaYBvnZzfui1cf1QOV4I6dEi7I=; b=RVt8xngP3OHaAeRgRikkEuyTegjYCiaKtRk0wh/w9N66oPyOTi+Ya+rgrNvAGN+zv8 lcokj4hhWBPyH8fb4GeRNHPST+Bl64cSoUwXtY29i/HfNFxgozBukdfDPk0kYAsIKVd1 0d8N405BnBAFi9+7f5AcQRMHi6HhWliGuTToHyQyIi8DoosjFFn0pttE0vihSYhUaZoV DZLFB5xtAdsZIjAADb1J9Cf0D+CBsyGUEfNz1Wwn/sypNji7pSRnLV9O2wrhDD2u7jfT pftaOh6+Jw6/Q1TjH7DqVDWzU1S/3JWhDFHGDyHhDeUPEoiz7iz/FKv5fF+m//I7QVey qM+A== X-Gm-Message-State: AGRZ1gI0CZ6I+C/WV5RsifQfiQl45Zlf+vYnjd23TfyrhM3BZ9xISL32 v4wjdWmO0rln9GMZW0FtEtJhsN/X X-Google-Smtp-Source: AJdET5c1Mx68R7rA863MBPLkCxbF1l/z3cAuzWm7qjjbAcrfuvRd4yhTRiqGEIBEZnRChyYY9s+spg== X-Received: by 2002:a17:902:7847:: with SMTP id e7-v6mr9758201pln.104.1541119628330; Thu, 01 Nov 2018 17:47:08 -0700 (PDT) Received: from rashmica.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id d29-v6sm53736243pgm.56.2018.11.01.17.47.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Nov 2018 17:47:07 -0700 (PDT) From: Rashmica Gupta To: pdbg@lists.ozlabs.org Date: Fri, 2 Nov 2018 11:46:43 +1100 Message-Id: <20181102004644.23047-4-rashmica.g@gmail.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181102004644.23047-1-rashmica.g@gmail.com> References: <20181102004644.23047-1-rashmica.g@gmail.com> Subject: [Pdbg] [PATCH v4 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 5a9d239..e83f21f 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 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 0fbf8ae..a52e1ed 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 5ccadfc..8415fea 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));