From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127698 invoked by alias); 12 Apr 2016 05:16:33 -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 127680 invoked by uid 89); 12 Apr 2016 05:16:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=7.5, Hx-languages-length:2372, remotely, 75 X-HELO: mail-wm0-f46.google.com Received: from mail-wm0-f46.google.com (HELO mail-wm0-f46.google.com) (74.125.82.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 12 Apr 2016 05:16:22 +0000 Received: by mail-wm0-f46.google.com with SMTP id u206so11994007wme.1 for ; Mon, 11 Apr 2016 22:16:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=3fqOi0q7fqNSqMureO9IWVq6k7DY6PZtMPWKukVq7jU=; b=eOnkfBBMGcFi8JgHL9bjsYItXp4twmyzWquQhcUHk4rv9eu840uwJABrN9MJ905BDa u0WPr5trgJtIGd7VfxqjS2p/yAEoK0RPaSom3Ah2oBLnZleTTHCeXQK4o+ceVv4JfmcM Np4s0x8Bjoq6ALDh+j1K0OwhxdaEJ+9vBpj3BI8+TB57LJYk1r0xvJGOsXq6IwI/yEX1 hdoIf6Fnd8Pl0nYN+kLukkwMYW0TwzeL9LXYVywyv00QQwQ2TIu8Un+ghBAvVBtMrGMf v5CIoRPPzYqtYZXBRFBwuqBDApkp8T3MaDmstlUkjtafzpiSPV36wG+CETgjXJID7m0b 16bQ== X-Gm-Message-State: AD7BkJIntMoGTcpVd9iql7Yg1Aa5tPmPs4gwzRrWBIwpFf727+njqBNrdAD6oT9QvR+bXnAbH7HQNY6aRdcrEQ== MIME-Version: 1.0 X-Received: by 10.28.129.84 with SMTP id c81mr21177451wmd.38.1460438179592; Mon, 11 Apr 2016 22:16:19 -0700 (PDT) Received: by 10.28.170.1 with HTTP; Mon, 11 Apr 2016 22:16:19 -0700 (PDT) In-Reply-To: <570C14D4.3030600@codesourcery.com> References: <570C14D4.3030600@codesourcery.com> Date: Tue, 12 Apr 2016 05:16:00 -0000 Message-ID: Subject: Re: PR13984 - gdb stops controlling a thread after "Remote 'g' packet reply is too long: ..." error message From: Orgad Shaneh To: Luis Machado Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00235.txt.bz2 Hi, On Tue, Apr 12, 2016 at 12:19 AM, Luis Machado wrote: > Hi, > > On 04/10/2016 09:49 AM, Orgad Shaneh wrote: >> >> Please review the attached patch. It was inspired by the patch >> attached to the bug report. > > > Usually, when you receive that message from GDB it because your target > reported an incorrect register set as a 'g' reply. > > The correct solution is to fix your remote target to reply the proper > register set. > > From the description, it sounds like QEMU needs to be adjusted. > Thanks for your reply. I don't use QEMU. I did not describe my use case in the bug report, did just now. I got this message when I tried to remotely debug a mips64-octeon-linux gdbserver 6.8 with GDB >= 7.5. GDB <= 7.4.1 works well, but with 7.5 and up I receive this message and the debugger stops functioning. The proposed patch fixes this issue for me. Using a newer gdbserver (Cavium SDK3 comes with 7.6) might also be a solution, but we need to support the old one as well. >> >> Thanks. >> >> >> 0001-PR13984-gdb-stops-controlling-a-thread.patch >> >> >> From 03ab95933b85dd85c2f4fa5797017e6cee0c8466 Mon Sep 17 00:00:00 2001 >> From: Orgad Shaneh >> Date: Sun, 10 Apr 2016 17:39:24 +0300 >> Subject: [PATCH] PR13984, gdb stops controlling a thread... >> >> ... after "Remote 'g' packet reply is too long: ..." error message >> >> PR13984: >> remote.c: Handle long g packets instead of failing >> --- >> gdb/remote.c | 6 +----- >> 1 file changed, 1 insertion(+), 5 deletions(-) >> >> diff --git a/gdb/remote.c b/gdb/remote.c >> index 5c407b6..e8951dc 100644 >> --- a/gdb/remote.c >> +++ b/gdb/remote.c >> @@ -7188,10 +7188,6 @@ process_g_packet (struct regcache *regcache) >> >> buf_len = strlen (rs->buf); >> >> - /* Further sanity checks, with knowledge of the architecture. */ >> - if (buf_len > 2 * rsa->sizeof_g_packet) >> - error (_("Remote 'g' packet reply is too long: %s"), rs->buf); >> - > > > This is a serious error. If GDB fetches a bogus register set reply, it will > most definitely do the wrong thing after this. Possibly, but doing "something wrong" is likely to be better than just quitting. Maybe we should leave the warning, but still correct the values used. - Orgad