From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18769 invoked by alias); 18 Apr 2016 13:23:57 -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 18756 invoked by uid 89); 18 Apr 2016 13:23:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2818 X-HELO: mail-wm0-f43.google.com Received: from mail-wm0-f43.google.com (HELO mail-wm0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 18 Apr 2016 13:23:46 +0000 Received: by mail-wm0-f43.google.com with SMTP id a140so119922951wma.0 for ; Mon, 18 Apr 2016 06:23:46 -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=yCZkTf70jDSYGPwLrwrd50xvOp9F+AjIvNfq9Lv8I5s=; b=g9Pj5FAGjJqCggCTc5LcRAoKhIA/Nc3C8/0zTlH3A98sE8HrdY7ZVmwGfHFWm0ugPZ r6IHuZRGwIbNy4NQ0JGsje+VlNpWYTTClMzQiDbNQJtd3PEzAV1Pa9/IIzEW1KzcNkQx Vuw4K1eRBXR5hIvAkfiHoe3j8dVd/nOCtD2+TN2utNafjJPQfKj36l/JUxrNS1eHXEws x5A0nljbVsBlPGgIzwdtd+arLoFadV8xJCNhnDMlc6Goy/Rbs8lKilzHyiqWtOvAME71 64kxr5M164H74WBSY/tgoI4TwwMla9X9gChJNEz5vLK3tQVIPHh/F2RAbzuzAFiWU4e+ ZpCA== X-Gm-Message-State: AOPr4FW0emgmPntBxWCUMrPZkAb7kmucC8/X9MK+gyY0rSuMjSfVCLMIHlZsNrqOb21Ua4ip6iGzXz0/mFK27w== MIME-Version: 1.0 X-Received: by 10.195.20.66 with SMTP id ha2mr25767412wjd.76.1460985823515; Mon, 18 Apr 2016 06:23:43 -0700 (PDT) Received: by 10.28.170.1 with HTTP; Mon, 18 Apr 2016 06:23:43 -0700 (PDT) In-Reply-To: References: Date: Mon, 18 Apr 2016 13:23:00 -0000 Message-ID: Subject: Re: [PATCH] MIPS: Go back with the default Linux # of registers to 90 From: Orgad Shaneh To: "Maciej W. Rozycki" Cc: Pedro Alves , Luis Machado , gdb-patches@sourceware.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2016-04/txt/msg00401.txt.bz2 On Mon, Apr 18, 2016 at 4:17 PM, Maciej W. Rozycki wrote: > Set the number of registers for non-XML-described Linux targets to 90, > reverting a change made here with the addition of DSP register support: > > commit 1faeff088bbbd037d7769d214378b4faf805fa2e > Author: Maciej W. Rozycki > Date: Thu Mar 1 22:19:48 2012 +0000 > > and fixing a regression introduced for legacy `gdbserver' targets > causing a "Remote 'g' packet reply is too long" error message where the > amount of register data received with a `g' packet (90) exceeds the > maximum number of registers expected (79). > > Update the setting for XML-described targets, reflecting the actual > number of registers which have been assigned numbers, matching the: > > gdb_assert (gdbarch_num_regs (gdbarch) <= MIPS_RESTART_REGNUM); > > requirement in `mips_linux_init_abi'. > > gdb/ > * mips-tdep.c (mips_gdbarch_init): For GDB_OSABI_LINUX set > `num_regs' to 90 rather than 79. Where a target description is > present adjust the setting appropriately. > --- > Orgad, > > Can you please check if this change addresses your problem? > > I'm not currently set up to fully regression-test this change with > `gdbserver', but I did some manual testing and things look right. The > change for `num_regs' in the XML-described case (which is now either 72 or > 79, for non-DSP and DSP targets respectively, rather than always 79) is in > particular going to be always overridden in `mips_linux_init_abi' with > `MIPS_RESTART_REGNUM + 1' (80) anyway -- we don't have proper support for > XML-described bare-metal targets, so only the Linux target matters. So I > think this patch is safe and I'm going to install it once I've got a > confirmation that the legacy case has been addressed. > > Maciej > > gdb-mips-gdbarch-init-linux-num-regs.diff > Index: binutils/gdb/mips-tdep.c > =================================================================== > --- binutils.orig/gdb/mips-tdep.c 2016-04-18 11:53:07.592133428 +0100 > +++ binutils/gdb/mips-tdep.c 2016-04-18 12:30:58.698574753 +0100 > @@ -8192,7 +8192,7 @@ mips_gdbarch_init (struct gdbarch_info i > mips_regnum.dspctl = -1; > dspacc = 72; > dspctl = 78; > - num_regs = 79; > + num_regs = 90; > reg_names = mips_linux_reg_names; > } > else > @@ -8311,6 +8311,8 @@ mips_gdbarch_init (struct gdbarch_info i > return NULL; > } > > + num_regs = mips_regnum.fp_implementation_revision + 1; > + > if (dspacc >= 0) > { > feature = tdesc_find_feature (info.target_desc, > @@ -8344,6 +8346,8 @@ mips_gdbarch_init (struct gdbarch_info i > > mips_regnum.dspacc = dspacc; > mips_regnum.dspctl = dspctl; > + > + num_regs = mips_regnum.dspctl + 1; > } > } > Hi, It seems to solve the issue. Thanks. - Orgad