From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86188 invoked by alias); 13 Jan 2017 12:29:38 -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 86165 invoked by uid 89); 13 Jan 2017 12:29:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*r:AES128-SHA, Hx-languages-length:957 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-lf0-f68.google.com Received: from mail-lf0-f68.google.com (HELO mail-lf0-f68.google.com) (209.85.215.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Jan 2017 12:29:36 +0000 Received: by mail-lf0-f68.google.com with SMTP id h65so5487113lfi.3; Fri, 13 Jan 2017 04:29:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=OB1aDIKCRjfBPlcmQ9vDE4Bmtb5zKTGd6F5lnpKqKgs=; b=Hkf7/XtwwnuPJflKskD3OFlzpDfoKf3N6G0xeixqJrByVa+KWKb5z7LAc9+nuLye5x glrt0NMH1cuIf/NNYzBzmq3ZiLzjobYjHFlyVds7d+uexVlcWmNojM/tI0HMKvIOxnE9 nPkyPQJbMYFD/e5um84+p/tPzzgtlVW614/KwydVtsAoayJoniu4nVSWHoF/hEF5UkSa 0ch46vzluWzyqXRPG+NsSrX4TruoZZPiIgiclIARXlfooO6sagRoVTAt2jSusMBP6aVG XJA/m6pzXS6nnmxMgZN6hYwP3Q5rDDB4d/hK5B1Xeha0mJET4txbf2rV/gje6FX+EX0M wZ/Q== X-Gm-Message-State: AIkVDXKemXNnlleh+uHsMM7f7ixbPRIUgbZsc6wccVtImgBjD3vvvRDTcD2JmpcP1May7A== X-Received: by 10.25.166.131 with SMTP id p125mr684279lfe.142.1484310574471; Fri, 13 Jan 2017 04:29:34 -0800 (PST) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id 26sm3827368ljo.24.2017.01.13.04.29.32 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 13 Jan 2017 04:29:33 -0800 (PST) Date: Fri, 13 Jan 2017 12:29:00 -0000 From: Yao Qi To: Alan Modra Cc: binutils@sourceware.org, gdb-patches@sourceware.org Subject: Re: [PATCH 6/8] Return -1 on memory error in print_insn_m68k Message-ID: <20170113122921.GC28060@E107787-LIN> References: <1484051178-16013-1-git-send-email-yao.qi@linaro.org> <1484051178-16013-7-git-send-email-yao.qi@linaro.org> <20170111221514.GI32333@bubble.grove.modra.org> <20170112115021.GB31406@E107787-LIN> <20170112143813.GK32333@bubble.grove.modra.org> <20170112145230.GE31406@E107787-LIN> <20170113015412.GQ32333@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170113015412.GQ32333@bubble.grove.modra.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2017-01/txt/msg00267.txt.bz2 On 17-01-13 12:24:12, Alan Modra wrote: > > > Actually there is a good reason not to change that call, I just didn't > > > look at the code well enough and thought you'd accidentally missed > > > it. The previous patch is OK. The newest one would fail if you had > > > a 2-byte insn at the end of a segment and happened to try a 4-byte > > > insn match first. > > > > > > > Hi Alan, > > This won't happen in the 2nd patch, because if the instruction is 2-byte, > > it won't read and match the next 2 bytes. There is a guard > > ((0xffff & match) != 0) for read. Am I missing something? > > The code is looping over an opcode table. You might try to match a > 4-byte instruction from the opcode table before matching the 2-byte > instruction you have. If you exit the loop due to failing to read 4 > bytes then you won't disassemble the instruction. > OK, the v1 is pushed in. -- Yao (齐尧)