From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by sourceware.org (Postfix) with ESMTPS id BE7193858413 for ; Tue, 21 Mar 2023 09:55:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BE7193858413 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-oi1-x229.google.com with SMTP id bo10so10677811oib.11 for ; Tue, 21 Mar 2023 02:55:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; t=1679392513; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=kYKKXIJc1yYVFgzYzZYGxP3/i9a6SivpN6Ja+x+MW7g=; b=K6EAMugf0XW72bRYrgCQOLna8teHHub06aIaPb6PaxrOZ95FUwiNCEnjMVX2nYClhf IWfJBuF52Mc6+ZOQVDC9UuQ7s1q+cVwXs5jRWEhTO4jalHnlnY5ZLr03BMbXCCUSSLEr 6F5KvNmtxL9mOo6OnZKemfR4xQHuPqd5xqmEFPNo4plfBVGdJJ4hGmUSs5TvAayaHevf pXLQzfwj0uWpOlOi842rlfvHZ6i5P8Zz/EabRNlD7v8s7uBhnN3osoLpQzzR13jWh1Z1 vslHcYwpZiK5+MNXMF8jI2MUgwc/NxRinb3M/mD/oxCOlYkxXsA1gOMb2plsun8TSsNj 3rQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679392513; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kYKKXIJc1yYVFgzYzZYGxP3/i9a6SivpN6Ja+x+MW7g=; b=0wceCQunaHqkGaOa2q/49Aakk+aWJohqS4GmLIqjrroCCd4yN2LDPT3Kvx747aZzM5 FcKSkLvr3DKqbqAXz8NmaBxqPN4q7TJHzmdsws7w5+ym5PbFsIc0U/dpF9ac0jYHC6MA Vwa3MShTImfKEsFESzUV7dS2qjDJObT9oj9ILeHu4+yg2oGhAPS0aFa+QuSR5SPByVAV fsFLdoXXRWrmdN6K/bIjdz+bamXzMJqbGHM2+x7hFbqbOgpu0oYIbdpNNnhlv3Gva0nD M2noaquTgEVfixB7U/4FBQosFow8oh9IbMBPd4jK/E6MTcJTHgkOzIQqGwQwGIXzaQs0 hr3Q== X-Gm-Message-State: AO0yUKXmN/bnjgXiSIk2mu4m55ptBpyOubFOQf0SZMnVlcviK3z8fb0q glRhQmZEad2EzQqrMaK/O4WXVzaXLYfyw0fAi4gVkg== X-Google-Smtp-Source: AK7set+xS91GPERK9DjBArIlqPbZCkOG1lua83xYJZH2Y6r/F5qy5rx1gI47IXaO2Zgpdz/hNSz+AN+2cTTWeTuK/CQ= X-Received: by 2002:a05:6808:3c6:b0:386:a6d2:30ac with SMTP id o6-20020a05680803c600b00386a6d230acmr438521oie.1.1679392513051; Tue, 21 Mar 2023 02:55:13 -0700 (PDT) MIME-Version: 1.0 References: <20230320033444.2819-1-jiawei@iscas.ac.cn> <87r0ticvd3.fsf@redhat.com> In-Reply-To: <87r0ticvd3.fsf@redhat.com> From: Nelson Chu Date: Tue, 21 Mar 2023 17:55:02 +0800 Message-ID: Subject: Re: Fwd: [PATCH v2] RISC-V: Fix disassemble fetch fail return value. To: Andrew Burgess , jiawei , Xiaolin Zheng Cc: gdb-patches@sourceware.org, Binutils Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Thanks, committed. On Tue, Mar 21, 2023 at 5:22=E2=80=AFPM Andrew Burgess wrote: > > Nelson Chu writes: > > > Hey gdb, Hey Andrew, > > > > We plan to accept this patch in binutils upstream since it will fix > > the pr30184, but not really sure if that will cause problems for > > risc-v gdb dis-assembler, or other stuff. It would be great if you > > guys also think it's safe enough to commit. > > This shouldn't cause any problems for GDB, so long as the returned value > is negative then GDB will treat this as an error. > > Fine to commit as far as I'm concerned. > > Approved-By: Andrew Burgess > > Thanks, > Andrew > > > > > Thanks > > Nelson > > > > ---------- Forwarded message --------- > > From: Xiaolin Zheng > > Date: Mon, Mar 20, 2023 at 1:52=E2=80=AFPM > > Subject: Re: [PATCH v2] RISC-V: Fix disassemble fetch fail return value= . > > To: Jiawei , binutils > > Cc: nelson , palmer , > > christoph.muellner , wuwei2016 > > > > > > > > Thank you Jiawei. this version LGTM though I am not a Binutils > > developer. Do Binutils reviewers have thoughts on this new version? > > Thanks in advance. > > > > ------------------------------------------------------------------ > > From:Jiawei > > Send Time:2023=E5=B9=B43=E6=9C=8820=E6=97=A5(=E6=98=9F=E6=9C=9F=E4=B8= =80) 11:35 > > To:binutils > > Cc:nelson ; palmer ; > > christoph.muellner ; =E9=83=91=E5=AD=9D=E6= =9E=97(=E4=BA=91=E7=9F=85) > > ; wuwei2016 ; > > Jiawei > > Subject:[PATCH v2] RISC-V: Fix disassemble fetch fail return value. > > > > This bug reported in > > https://sourceware.org/bugzilla/show_bug.cgi?id=3D30184 > > And discussed in > > https://sourceware.org/pipermail/binutils/2023-February/126213.html > > > > We also checked the implementation of return value in arm and mips. > > So this patch changes the return value to -1, that can fix bugs and mai= ntain > > consistency with other architectures. > > > > opcodes/ChangeLog: > > > > * riscv-dis.c (print_insn_riscv):Change the return value. > > > > --- > > opcodes/riscv-dis.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c > > index 7baba054daa..f431124b423 100644 > > --- a/opcodes/riscv-dis.c > > +++ b/opcodes/riscv-dis.c > > @@ -1059,7 +1059,7 @@ print_insn_riscv (bfd_vma memaddr, struct > > disassemble_info *info) > > if (status !=3D 0) > > { > > (*info->memory_error_func) (status, memaddr, info); > > - return status; > > + return -1; > > } > > insn =3D (insn_t) bfd_getl16 (packet); > > dump_size =3D riscv_insn_length (insn); > > @@ -1071,7 +1071,7 @@ print_insn_riscv (bfd_vma memaddr, struct > > disassemble_info *info) > > if (status !=3D 0) > > { > > (*info->memory_error_func) (status, memaddr, info); > > - return status; > > + return -1; > > } > > insn =3D (insn_t) bfd_get_bits (packet, dump_size * 8, false); > > > > -- > > 2.25.1 >