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: 979551 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="UyuolF6N"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42RZ9s5WW9z9s4s for ; Sat, 6 Oct 2018 01:56:17 +1000 (AEST) Received: from localhost ([::1]:35732 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8SSc-0005gt-Ur for incoming@patchwork.ozlabs.org; Fri, 05 Oct 2018 11:56:15 -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-Google-Smtp-Source: ACcGV60Xmy6kRSv72IidCDdRQGtpmKEJw2QPF/XjY3mtbQQTnbj+mNIVPS+BsMUOXRK2hAzNS6rS2Q== 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+incoming=patchwork.ozlabs.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 Reviewed-by: Richard Henderson --- 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 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();