From nobody Wed Nov 5 10:41:21 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1533837492186353.4606644640935; Thu, 9 Aug 2018 10:58:12 -0700 (PDT) Received: from localhost ([::1]:52237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnpCM-0001Cv-Tp for importer@patchew.org; Thu, 09 Aug 2018 13:58:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnpAG-0008Ll-Pu for qemu-devel@nongnu.org; Thu, 09 Aug 2018 13:56:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fnpAF-0004j7-7H for qemu-devel@nongnu.org; Thu, 09 Aug 2018 13:56:00 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:37789) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fnpAE-0004iQ-Vg for qemu-devel@nongnu.org; Thu, 09 Aug 2018 13:55:59 -0400 Received: by mail-wr1-x441.google.com with SMTP id u12-v6so5892058wrr.4 for ; Thu, 09 Aug 2018 10:55:58 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id b13-v6sm9699724wrs.43.2018.08.09.10.55.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Aug 2018 10:55:55 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 13EB73E0625; Thu, 9 Aug 2018 18:55:54 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RKewQxtxItzFSUaEhi8cjiLKk+zd6n6oRJFO+Q8/etQ=; b=BIKUp0vBxN50bVHCh+vOVwwgklUIzm3ink/n+SEgBzYomSgHecCur1eoLSnwhdxJHb 9eEvH4B673VK4JQYW465Rt/blfjW1DaCjs5JtZCL/JOlsil8YCd4gteFvuafwSorG2iS v/0eU3mFTBTN/NJq9WCOVcayd6f49k7zdMN0U= 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:mime-version:content-transfer-encoding; bh=RKewQxtxItzFSUaEhi8cjiLKk+zd6n6oRJFO+Q8/etQ=; b=sTgWHy1heytlRBzJCxaJ4j36c4WK575z2HmKV8zjyHhSqsjEXdKUAyOJmq5RhlS44l /Ge6KVQhQEJ9TltnbtXKwQGL1XIykNYY15AqPKBO8Z02nAWc8kspHBjx+Acp2/HFpWX1 t0GiBuba/Xd3/5oHzj0Uh3t+eWdSeyT2C6fqe6N71NGDYkSSNtrzJ6+9wLOeniE4EaQJ U52oaA2uFaIofZLmLAfbFsREy1WBl1vaVW14VeuxEydjNFBBiB8x/q8AEfNv0HoUXHqn 2wVcm36pCtTqGEcyYcwR4J9XmDiOoUzMLrKmKxw360GFhoTG86/abKh+1rgzn1hoo3ci UUxg== X-Gm-Message-State: AOUpUlE2JDABng7k+Ie+19sjZjIoDqcU8SK85/R4qN7Y6sOhKKO17vMV 6oTMaeQGJcInJdGlDKYK6mCOtA== X-Google-Smtp-Source: AA+uWPz5kTcEbNIsvsJnmxS916cLf6uwfHoqn2omTsMMba+tR8y8qJYXJSzWzM+sNRS18fnQQLJEKg== X-Received: by 2002:adf:afd3:: with SMTP id y19-v6mr2323367wrd.176.1533837357590; Thu, 09 Aug 2018 10:55:57 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 9 Aug 2018 18:55:53 +0100 Message-Id: <20180809175553.18479-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180809175553.18479-1-alex.bennee@linaro.org> References: <20180809175553.18479-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 Subject: [Qemu-devel] [RFC PATCH 3/3] linux-user: add -dfilter progtext shortcut X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 When debugging you often don't care about the libraries but just the code in the testcase. Rather than make the user build this by hand offer a shortcut. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Laurent Vivier --- linux-user/main.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/linux-user/main.c b/linux-user/main.c index ea00dd9057..8d4427727e 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -28,6 +28,7 @@ #include "qemu/config-file.h" #include "qemu/cutils.h" #include "qemu/help_option.h" +#include "qemu/range.h" #include "cpu.h" #include "exec/exec-all.h" #include "tcg.h" @@ -51,6 +52,8 @@ unsigned long mmap_min_addr; unsigned long guest_base; int have_guest_base; =20 +static bool dfilter_progtext; + /* * When running 32-on-64 we should make sure we can fit all of the possible * guest address space into a contiguous chunk of virtual host memory. @@ -222,6 +225,11 @@ static void handle_arg_log(const char *arg) =20 static void handle_arg_dfilter(const char *arg) { + if (strcmp(arg, "progtext") =3D=3D 0) { + dfilter_progtext =3D true; + return; + } + qemu_set_dfilter_ranges(arg, NULL); } =20 @@ -423,7 +431,7 @@ static const struct qemu_argument arg_table[] =3D { "item[,...]", "enable logging of specified items " "(use '-d help' for a list of items)"}, {"dfilter", "QEMU_DFILTER", true, handle_arg_dfilter, - "range[,...]","filter logging based on address range"}, + "range|progtext[,...]", "filter logging based on address range"}, {"D", "QEMU_LOG_FILENAME", true, handle_arg_log_filename, "logfile", "write logs to 'logfile' (default stderr)"}, {"p", "QEMU_PAGESIZE", true, handle_arg_pagesize, @@ -796,6 +804,12 @@ int main(int argc, char **argv, char **envp) qemu_log("auxv_start 0x" TARGET_ABI_FMT_lx "\n", info->saved_auxv= ); } =20 + if (dfilter_progtext) { + Range r; + range_set_bounds(&r, info->start_code, info->end_code); + qemu_append_dfilter_range(r, NULL); + } + target_set_brk(info->brk); syscall_init(); signal_init(); --=20 2.17.1