From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14129 invoked by alias); 17 Apr 2014 17:27:45 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 14114 invoked by uid 89); 17 Apr 2014 17:27:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mail-la0-f53.google.com Received: from mail-la0-f53.google.com (HELO mail-la0-f53.google.com) (209.85.215.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 17 Apr 2014 17:27:43 +0000 Received: by mail-la0-f53.google.com with SMTP id b8so632425lan.12 for ; Thu, 17 Apr 2014 10:27:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=FYGSTUXy4z/VpXBtDhcdM3DK7C5NOtWT4XfEVmzyXgE=; b=GVLYMHINBqs2SI6iwwFubwJgCP238JuAUPMeJgx0GhBNVjccPquIbKBfCxptznG8wy AljkkkgfsZkEGPFfM134dAnEkIuGKMwCTvZFQ4bB609SnmGk7GTtoH2cejq4Q+dhqef8 dxUHXgl/JqM9NQ129llGYTnyNzEmUyyf/SO4e543OLg1LDJC0lmSaCIva4Y2T4TVIkUP B2vBUPVzbeNhUsQziacrzxA/24Cr0Ff6Xi11bC2D/DczC/Z3LBMwl7IxYhqI3BVPZ6W/ Az5MyZKf93a52yuFTShiBnpCT7qX8PtohzJ9yPAPgGRqcBamQ7eHU4RDxtPPGARXMvEz ni+A== X-Gm-Message-State: ALoCoQkG9ATEq3y+YoQ8mEIgW0i/F6TZZFWn4t6KqiX/5enb9s30ipj4bYd3Oc9bNhPoM8Z8DzST MIME-Version: 1.0 X-Received: by 10.152.7.97 with SMTP id i1mr2748004laa.36.1397755659324; Thu, 17 Apr 2014 10:27:39 -0700 (PDT) Received: by 10.112.9.40 with HTTP; Thu, 17 Apr 2014 10:27:39 -0700 (PDT) In-Reply-To: References: <534F294D.4050907@codesourcery.com> Date: Thu, 17 Apr 2014 17:27:00 -0000 Message-ID: Subject: Re: [PATCH] Fix alignment of disassemble /r From: Daniel Gutson To: Doug Evans Cc: Yao Qi , gdb-patches Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-04/txt/msg00371.txt.bz2 On Thu, Apr 17, 2014 at 1:27 PM, Doug Evans wrote: > On Thu, Apr 17, 2014 at 7:37 AM, Daniel Gutson > wrote: >> So what if I add a new configuration variable, such as >> set disassemble-raw-alignment >> with "off" as default, and if set to on, pad to gdbarch_max_insn_length ? > > Presumably some frontends will do their own alignment. > > If we went with disassemble-raw-alignment, a boolean value won't help > x86 much, it's either no alignment or (in general) too much > whitespace. > An improvement would be a value from min-insn-length to > max-insn-length, but that would be problematic in a multi-arch > debugging scenario. > > If we could agree on some minimum alignment for each variable-length > ISA (5 would be fine for me for x86) then maybe a boolean value could > be useful ("off" =3D no alignment, "on" =3D employ arch-specific minimum). > > OTOH, what if we made two passes over the instructions, with the first > pass computing the maximum instruction length that is present? I already considered this, but thought that it would be going to be rejected due to be too much non-performant. Wouldn't each pass translate in a lot of MI messaging in a case of a remote server? And, what about screen paginig? I shouldn't iterate over all the range, but the screen height range only. I can go for any of the proposed solutions. 5 insn-length was fine for me. On a side note, I did this since I was debugging some self-modifying-code where the mis-alignment was driving me crazy. The two-passes solution is the one I dislike more IMVHO. Yet another option is to set the disassembly raw alignment width, something= like set disassemble-raw-width 5 (5 is the amount of insn; 0 means no padding equal to the current behavior and that would be the default value). Daniel. > [And maybe only doing this for CLI.] --=20 Daniel F. Gutson Chief Engineering Officer, SPD San Lorenzo 47, 3rd Floor, Office 5 C=C3=B3rdoba, Argentina Phone: +54 351 4217888 / +54 351 4218211 Skype: dgutson