From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 49C1F3858C31; Tue, 12 Sep 2023 14:49:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 49C1F3858C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694530144; bh=RGfBqHiF8Cl+y0ccDUv1ds9Z5cFYzlD5JmOYlNTZwdA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=faj+d35YA8LiF1wbajFNLLKI9yeitYJ3GcbdtX+CfbcGnIcw3ZvpZhKGXFGWLrtdL ezyYDD8q4HrmsXY2+QRCTAFZOQzQttzTO/u1Yxgkg972AtUf2PceoumuneE3h7YUdP Q2NjoazHu+ostGHzYw19SXVw9PffT/QyOFt15wS4= From: "konsolebox at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug server/13984] gdb stops controlling a thread after "Remote 'g' packet reply is too long: ..." error message Date: Tue, 12 Sep 2023 14:49:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: server X-Bugzilla-Version: 7.4 X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: konsolebox at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D13984 konsolebox changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |konsolebox at gmail dot com --- Comment #16 from konsolebox --- (In reply to Mehmet Ali SARIKAYA from comment #3) > Comment on attachment 8506 [details] > gdb/remote.c change set >=20 > 6064 /* Further sanity checks, with knowledge of the architecture.=20 > 6065 //SunnyBeike > 6066=20 > 6067 // if (buf_len > 2 * rsa->sizeof_g_packet)=20 > 6068 // error (_("Remote 'g' packet reply is too long: %s"), rs->buf);=20 > 6069=20 > 6070 if(buf_len > 2 * rsa->sizeof_g_packet) { > 6071 rsa->sizeof_g_packet =3D buf_len; > 6072 for(i =3D 0; i < gdbarch_num_regs(gdbarch); i++){ > 6073 if(rsa->regs->pnum =3D=3D -1) > 6074 continue; > 6075 if(rsa->regs->offset >=3D rsa->sizeof_g_packet) > 6076 rsa->regs->in_g_packet =3D 0; > 6077 else > 6078 rsa->regs->in_g_packet =3D 1; > 6079 }=20 > 6080 } > 6081 Hello Mehmet, Thank you for sharing your patch. It worked for me, at least by concept, b= ut did you miss adding index references to each rsa->regs element in the loop? I modified it to make it work with 13.2 and also so that each loop refers t= o a different rsa->regs element. Kindly refer to it to see what I mean. I also made it a bit simpler: diff --git a/gdb/remote.c b/gdb/remote.c index 218bca3..f715dec 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -8482,10 +8482,17 @@ remote_target::process_g_packet (struct regcache *regcache) /* Further sanity checks, with knowledge of the architecture. */ if (buf_len > 2 * rsa->sizeof_g_packet) - error (_("Remote 'g' packet reply is too long (expected %ld bytes, got= %d " - "bytes): %s"), - rsa->sizeof_g_packet, buf_len / 2, - rs->buf.data ()); + { + rsa->sizeof_g_packet =3D buf_len; + + for (i =3D 0; i < gdbarch_num_regs (gdbarch); i++) + { + struct packet_reg *r =3D &rsa->regs[i]; + + if (r->pnum !=3D -1) + r->in_g_packet =3D (r->offset >=3D rsa->sizeof_g_packet) ? 0 : = 1; + } + } /* Save the size of the packet sent to us by the target. It is used as a heuristic when determining the max size of packets that the --=20 You are receiving this mail because: You are on the CC list for the bug.=