From patchwork Fri Oct 5 15:48:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 148204 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp620420lji; Fri, 5 Oct 2018 08:58:13 -0700 (PDT) X-Google-Smtp-Source: ACcGV61OR9ZtH92ndKmaQBEbxLZkWb1J5hOmcH1D6cvUkKVzYXN7JoWPnk1+6ADpnxYjyUjL8Aqc X-Received: by 2002:ac8:f57:: with SMTP id l23-v6mr9970665qtk.158.1538755093860; Fri, 05 Oct 2018 08:58:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538755093; cv=none; d=google.com; s=arc-20160816; b=qDAb93SQFC+UtyVQTWeuqdDVm5ATYFJP4QokmPhLiIn3KeA/6TqtJjk0F0179+jiXe BObUwHrkUgG8IplPMFcIU43fRLr2riot0kB4DmA9Ey17lni23+Bp2ab4yNNM1pn8Z28w GseSvYF32YpQ0geNha/asmV2W2We2MAns9szFKiXuqTqxPw/YXj5MRTPbMYzng4kbdLN uM5GVahX7vcfCCb0VsW9Cjwrn1SKVl/Vx1YDAIkzUCxwci1m4EDw9WMovJt1Bjl/UBRx pZXj88yUzyXqPqYktsJTUVE8/M7/HSMVdl+zbreOAqQ8lrHLjcweg+pc1W9/JmU7xDtP b+3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=9PaHLO4QvMOVEhvzt3qos7UmOXADa5a3nvimofpCjDk=; b=KJ6sTSF0QqoUq6/R0juDy3dG1eYTqZmZED/6l5W8VaeapD2I7HOI46FcoIe+yLWXwR 2ekRvQB1YIaslJcYiElc7PpbznkOWSq3C/Ce/Omwzk2/QMKbr0fpfEd8WrtW+Az+fMxC WEx7+uggO76HaAZRyFT4jz82NUSJP0CEZ82EqaECmQtOQzPE/7AeN+uAyyXrhTYBN7/t ifAWRXEJ2cjEMM+luwoVf3eUSPxBfdC7LkXT5WGVkq1q5WFUlooD/ZzXhpUY5+V84UXy OS+C4+u3UOlLXEZ1YQ3jjqc1tBw4yalwsCkidj7HdQH1vEbSqA3jGuKCbE7eKw1Dfxh/ 25Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UyuolF6N; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 3-v6si5825997qvx.161.2018.10.05.08.58.13 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 05 Oct 2018 08:58:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UyuolF6N; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35741 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8SUX-0000Po-9n for patch@linaro.org; Fri, 05 Oct 2018 11:58:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8SM9-0006ZC-EN for qemu-devel@nongnu.org; Fri, 05 Oct 2018 11:49:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8SM7-0006B4-Na for qemu-devel@nongnu.org; Fri, 05 Oct 2018 11:49:33 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:54217) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g8SM7-00060v-Ci for qemu-devel@nongnu.org; Fri, 05 Oct 2018 11:49:31 -0400 Received: by mail-wm1-x344.google.com with SMTP id b19-v6so2315953wme.3 for ; Fri, 05 Oct 2018 08:49:16 -0700 (PDT) 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=9PaHLO4QvMOVEhvzt3qos7UmOXADa5a3nvimofpCjDk=; b=UyuolF6NkrgrMgBFA5ifcoRu/w0HCiPsD/HCwLh9L2Ht4VDSSPxbnE2GDI3mPtf5kC E+HHSZku1F/3IJtdY1tcLoR61kPLc/FxXPhtRynbVNH2guZx8Y3j2WfZmIuLw06eYHeU SrLZBWFk62kGo4Bp7edFOIGT2mQHYyhSZ74m4= 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=9PaHLO4QvMOVEhvzt3qos7UmOXADa5a3nvimofpCjDk=; b=jEadUUgbGKHwsmYhpsVs+5ta6joNPEEmdo0s9rDIcM1Sn0CJ9htxvc65JPttQ5hBZS YQ3IMRnX9YJww+LYe3cTgZT0b43T6259fpuGQ9bzZx/63DHtsDUeaL5RhcnMlfRJnD2X CmbbQq2DakXZxNu6Cpi/M+QRjHs6XrAV+QboKD73IJhTHUc2dhL0oQrNdHdmm3pcTh+o q5rL+epJEo63LZebMq/eWexP6y50TjOMPnNH/y559Z+sAQkQXuCADA2DyvzQhR1wt7ik NvL3jAyiUmLV+1UXQDkOo9qjtFdYKymDMgJqIzmkakDEYSgAcszSK1om7hT2j7RNwHic CM3g== X-Gm-Message-State: ABuFfohjgax51IP6ZsbA5+j+mz6xGkinsEhHEIC6EOc24LsBWdMncuj1 7rDRTSnME83mA6leIUYMommo7w== X-Received: by 2002:a7b:c259:: with SMTP id b25-v6mr7938258wmj.138.1538754555344; Fri, 05 Oct 2018 08:49:15 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id k25-v6sm14087216wre.18.2018.10.05.08.49.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Oct 2018 08:49:12 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id EBB5A3E05CF; Fri, 5 Oct 2018 16:49:10 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Fri, 5 Oct 2018 16:48:52 +0100 Message-Id: <20181005154910.3099-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181005154910.3099-1-alex.bennee@linaro.org> References: <20181005154910.3099-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [RFC PATCH 03/21] 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 , Laurent Vivier , cota@braap.org, Pavel.Dovgaluk@ispras.ru, =?utf-8?q?Alex_Benn=C3=A9e?= , vilanova@ac.upc.edu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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ée Reviewed-by: Laurent Vivier --- linux-user/main.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) -- 2.17.1 Reviewed-by: Richard Henderson diff --git a/linux-user/main.c b/linux-user/main.c index 923cbb753a..a68674d0de 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; +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) static void handle_arg_dfilter(const char *arg) { + if (strcmp(arg, "progtext") == 0) { + dfilter_progtext = true; + return; + } + qemu_set_dfilter_ranges(arg, NULL); } @@ -423,7 +431,7 @@ static const struct qemu_argument arg_table[] = { "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); } + 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();