From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id APWlATGPbF97ewAAWB0awg (envelope-from ) for ; Thu, 24 Sep 2020 08:21:05 -0400 Received: by simark.ca (Postfix, from userid 112) id EF23B1EE05; Thu, 24 Sep 2020 08:21:04 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id BD29D1E599 for ; Thu, 24 Sep 2020 08:21:03 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 27E53385781F; Thu, 24 Sep 2020 12:21:03 +0000 (GMT) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by sourceware.org (Postfix) with ESMTPS id E1CA3385781F for ; Thu, 24 Sep 2020 12:21:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E1CA3385781F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=alves.ped@gmail.com Received: by mail-wm1-f67.google.com with SMTP id e17so3338056wme.0 for ; Thu, 24 Sep 2020 05:21:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4QiUhqtzMUCmWYCnijyyAARymtmMqmxstpR/hjVsrdw=; b=nxLEKxHggiAmSvEx0bgy85KEi4JjvqdxfcGbEd/sY0sI6M8WY+g1niFB6SJQDEf0i9 c6w44l5pTaY+ank0sS0YMW+4q1ZQ6JCbt3H23p4utvQnzQ7agIGNlojMHGj3irSF5GGP 8bLaWm1RQWQLl5l8ds4D2ShPpWxnjxniicGLcswYhKq5/s4UUCRDzv6/LHzzqczPs3Zl m/z6cBv0sG3cevvr9Kq3nsq75a0F7GDziimKmJwW/ME17HHX/kuH2JmeJZ7zwQYn64La gAWnNTJ1Hf+5CrQcA4bioL5SHNlHdhGnTJ2D4k8BzgvmKbNgU++61SIYC+T1U0Lz0yMd Hekg== X-Gm-Message-State: AOAM530PqgWQvpnfi39wXzbz1oODJSv/agrX57kLyPhg8t3MNn+YRx91 nacZOhyn3aVAf7P+h5+uQBzGM+3+nxrJwQ== X-Google-Smtp-Source: ABdhPJwpy1sjxHbKwvOAY3Cz8+rCk7M6w9vDo2u6QAy/lSA0BrB812ANaNGpZcEg8IYkJ80QeqVySg== X-Received: by 2002:a1c:3bd7:: with SMTP id i206mr4504613wma.162.1600950059130; Thu, 24 Sep 2020 05:20:59 -0700 (PDT) Received: from ?IPv6:2001:8a0:f905:5600:eefd:c63:53e0:3e8a? ([2001:8a0:f905:5600:eefd:c63:53e0:3e8a]) by smtp.gmail.com with ESMTPSA id b8sm3092935wmb.4.2020.09.24.05.20.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Sep 2020 05:20:57 -0700 (PDT) Subject: Re: [PATCH v2] disass: Add /x modifier to print offsets in hex To: Andrew Burgess , fam@euphon.net References: <20200923101906.2897399-1-fam@euphon.net> <20200924110514.GJ1540618@embecosm.com> From: Pedro Alves Message-ID: <22205c9c-aab7-c160-661a-e1a500d28f7d@palves.net> Date: Thu, 24 Sep 2020 13:20:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20200924110514.GJ1540618@embecosm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 9/24/20 12:05 PM, Andrew Burgess wrote: > * fam@euphon.net [2020-09-23 10:19:06 +0000]: > >> From: Fam Zheng >> >> Backtrace messages printed by Linux kernel and Xen have hex offsets, >> e.g.: >> >> (XEN) Xen call trace: >> (XEN) [] R guest_walk_tables_2_levels+0x189/0x66d >> (XEN) [] F hap_p2m_ga_to_gfn_2_levels+0x112/0x25b >> (XEN) [] F hap_gva_to_gfn_2_levels+0x1c/0x1e >> (XEN) [] F paging_gva_to_gfn+0x14a/0x167 >> >> Having this modifier saves converting between hex values from the >> backtrace log and offsets in gdb disass output. >> >> --- >> >> v2: Drop a overlooked change on file header. >> --- >> gdb/cli/cli-cmds.c | 17 ++++++++++++----- >> gdb/disasm.c | 6 +++++- >> gdb/disasm.h | 1 + >> gdb/record.c | 3 +++ >> 4 files changed, 21 insertions(+), 6 deletions(-) >> >> diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c >> index e3965fea07..2266f67695 100644 >> --- a/gdb/cli/cli-cmds.c >> +++ b/gdb/cli/cli-cmds.c >> @@ -1456,12 +1456,12 @@ disassemble_current_function (gdb_disassembly_flags flags) >> /* Dump a specified section of assembly code. >> >> Usage: >> - disassemble [/mrs] >> + disassemble [/mrsx] >> - dump the assembly code for the function of the current pc >> - disassemble [/mrs] addr >> + disassemble [/mrsx] addr >> - dump the assembly code for the function at ADDR >> - disassemble [/mrs] low,high >> - disassemble [/mrs] low,+length >> + disassemble [/mrsx] low,high >> + disassemble [/mrsx] low,+length >> - dump the assembly code in the range [LOW,HIGH), or [LOW,LOW+length) >> >> A /m modifier will include source code with the assembly in a >> @@ -1472,6 +1472,8 @@ disassemble_current_function (gdb_disassembly_flags flags) >> >> A /r modifier will include raw instructions in hex with the assembly. >> >> + A /x modifier will print offsets in hex. > > Shouldn't this be 'An /x modified ...' ? Saying it out loud it > certainly seems that way. Not if you read it as "a slash x modifier". I would guess that that's why it's also written "A /r" and "A /m modifier"?