From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42358 invoked by alias); 12 Jan 2017 14:52:46 -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 41498 invoked by uid 89); 12 Jan 2017 14:52:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*r:AES128-SHA, =e5=b0=a7?= X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-wm0-f68.google.com Received: from mail-wm0-f68.google.com (HELO mail-wm0-f68.google.com) (74.125.82.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Jan 2017 14:52:44 +0000 Received: by mail-wm0-f68.google.com with SMTP id r144so4237371wme.0; Thu, 12 Jan 2017 06:52:43 -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=J8Pfz93GnDomBNW8/jIT4BEwKXjNoxMRJIogbuEvDds=; b=uReUBecDgPsTASTkdJXzoq7pxjR+ESUtsxepHWzk6mYY67pvEN5AcAnIvLhaw4Q/5+ /X0HgZwRHGi5NC9AzuYdBnpZKomQ6ktHj4iUTZU72QflFd0YOn9zjPuykyAx/ZDDpTZi kBF869KqWEXBw2JTiYOY5heVOlXL5ALdM5aFjSY1GXIvmgZUzN+mprS+idh9Xa+JEFlh /4/4N4ZK9E3Eb1zd7eQHK7moLhgmAngW+McVkiAOTy3uE4qCHLais4S8F7uBaSwKlcfA c8pVlVdk8mz5r2YaAlkFXdGlwxuq7cQwq8dLj78XDfu+sM+/nB7oP5zpmI375Bc+Pg2I 1jDQ== X-Gm-Message-State: AIkVDXJKBLKnYsBXRD3hjQfNQt/2cN8ctdGxekm6OKsAsewLah9ikVPc047y+X65WhH/Ng== X-Received: by 10.223.173.183 with SMTP id w52mr7514040wrc.164.1484232762005; Thu, 12 Jan 2017 06:52:42 -0800 (PST) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id kk10sm12014331wjb.31.2017.01.12.06.52.39 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 12 Jan 2017 06:52:41 -0800 (PST) Date: Thu, 12 Jan 2017 14:52: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: <20170112145230.GE31406@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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170112143813.GK32333@bubble.grove.modra.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2017-01/txt/msg00228.txt.bz2 On 17-01-13 01:08:14, Alan Modra wrote: > On Thu, Jan 12, 2017 at 11:50:21AM +0000, Yao Qi wrote: > > On 17-01-12 08:45:14, Alan Modra wrote: > > > On Tue, Jan 10, 2017 at 12:26:16PM +0000, Yao Qi wrote: > > > > * m68k-dis.c (match_insn_m68k): Extend comments. Return -1 > > > > if FETCH_DATA returns 0. > > > > (m68k_scan_mask): Likewise. > > > > (print_insn_m68k): Update code to handle -1 return value. > > > > > > This misses one FETCH_DATA call, in m68k_scan_mask. > > > > > > > I can't remember the reason I didn't change it. Sorry. > > 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? -- Yao (齐尧)