From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 6AF303858D37 for ; Tue, 21 Mar 2023 09:22:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6AF303858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679390525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dulFnBnQYFkQzbwmXhiogso6MUsGPXqrPGu3ZOa+WrA=; b=Sz+sZj56LPkJnXx70YbK8SOtFnjBXliUFcTDmR3RYx2FbI5PHGpgj6xtQ0c7JPpKOAWGT9 cpCPUr4gQyeJOLLjyDCgf6OQdkQFK0tZg2ya6dKrYw2YXaHAWWypKAVsyyXonkB56L7eVs Z0XDkjNCcwqQkLcmq06wQs+wPTSs/wM= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-265-xay55-_zO6Wvd1EjTTcimg-1; Tue, 21 Mar 2023 05:22:03 -0400 X-MC-Unique: xay55-_zO6Wvd1EjTTcimg-1 Received: by mail-wm1-f70.google.com with SMTP id m30-20020a05600c3b1e00b003ed31d151ecso5570351wms.1 for ; Tue, 21 Mar 2023 02:22:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679390522; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=dulFnBnQYFkQzbwmXhiogso6MUsGPXqrPGu3ZOa+WrA=; b=TAVpghb1gh6cPr+VdTtCDc26d5ASLSanPgJE+ingp4eLJC6TRBF/8l45Jp19RCcqPq 4ka/l1UqM3EcTa/XL9994E7GItjJ+oa+Jm6DuDyAP7q1Z40sRNDArH+1XPz8xyClYjo0 H4Ka0VNdkuq/LGgxr9HamzdSqs9vqgtmOzItrAvcPT95V4UdXdO+AOeRJ17DcK+Ob7+/ K3E/B6SkQXn1fi4+ky9etgAV4sp1f1zyI6VXkeylnFEUrdwIJX0dzCy+ezoPcwgiftlg bIiUf2ARbl8vALzwppsVCdOuw1CMcKclKUYVqPb7+0P5+xugC8T1eNrhWmVIGAFmmRgJ oLcA== X-Gm-Message-State: AO0yUKV20q/cgaqrJv2q/PAQLXbLYlt3gNhW5f0f8nIqAyQ2RldYphw5 6p9KRN4s4GRnWrb2l1jHNhOxm6C4fVyVI3hgV1boIi0PBlzW9YBYFwSw2emNmuQBqZNY0eiVFpA w6Xv63fkYjSSzd2hw41nA9t3krPiDDw== X-Received: by 2002:a1c:ed14:0:b0:3ed:29f3:d69f with SMTP id l20-20020a1ced14000000b003ed29f3d69fmr1839995wmh.36.1679390522724; Tue, 21 Mar 2023 02:22:02 -0700 (PDT) X-Google-Smtp-Source: AK7set8Z5ZOBvrXvBPtl9Eyzlucc7F9pZNCqm8+JzQnKuzgPCF6aLad11zXBRLX4ypBpzTXKpXzsyg== X-Received: by 2002:a1c:ed14:0:b0:3ed:29f3:d69f with SMTP id l20-20020a1ced14000000b003ed29f3d69fmr1839978wmh.36.1679390522332; Tue, 21 Mar 2023 02:22:02 -0700 (PDT) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id n1-20020a7bc5c1000000b003db03725e86sm13219377wmk.8.2023.03.21.02.22.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Mar 2023 02:22:02 -0700 (PDT) From: Andrew Burgess To: Nelson Chu , gdb-patches@sourceware.org Subject: Re: Fwd: [PATCH v2] RISC-V: Fix disassemble fetch fail return value. In-Reply-To: References: <20230320033444.2819-1-jiawei@iscas.ac.cn> Date: Tue, 21 Mar 2023 09:22:00 +0000 Message-ID: <87r0ticvd3.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00,BODY_8BITS,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: 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 maint= ain > 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); > > --=20 > 2.25.1