From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17934 invoked by alias); 17 Sep 2013 12:33:08 -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 17922 invoked by uid 89); 17 Sep 2013 12:33:07 -0000 Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 17 Sep 2013 12:33:07 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id A8F071164DF; Tue, 17 Sep 2013 08:33:19 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id YoHY8Rfd6CLF; Tue, 17 Sep 2013 08:33:19 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id E3E2A116600; Tue, 17 Sep 2013 08:33:18 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id E6E5FE1290; Tue, 17 Sep 2013 05:33:04 -0700 (PDT) Date: Tue, 17 Sep 2013 12:33:00 -0000 From: Joel Brobecker To: Jiong Wang Cc: gdb-patches@sourceware.org Subject: Re: [RFC/TileGX 2/2] fix gdbserver runtime crash Message-ID: <20130917123304.GE3132@adacore.com> References: <50F9148F.3010602@tilera.com> <5237C847.3040908@tilera.com> <5237CB65.4000703@tilera.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5237CB65.4000703@tilera.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-09/txt/msg00494.txt.bz2 > TileGX is always 64bit, ptrace always return 64bit data, tilegx32 > is just an ABI. > > So the regset size should be regnum * 8 instead of regnum * 4. The > latter cause gdbserver crash. > > gdbserver/ChangeLog: > > * linux-tile-low.c (tile_regsets): Modify the size field as 64bit > for each register. I will trust you on this one, but how did this even work at all prior to your change??? > diff --git a/gdb/gdbserver/linux-tile-low.c b/gdb/gdbserver/linux-tile-low.c > index 8963b9a..8efb34e 100644 > --- a/gdb/gdbserver/linux-tile-low.c > +++ b/gdb/gdbserver/linux-tile-low.c > @@ -124,7 +124,7 @@ tile_store_gregset (struct regcache *regcache, const void *buf) > > static struct regset_info tile_regsets[] = > { > - { PTRACE_GETREGS, PTRACE_SETREGS, 0, tile_num_regs * 4, > + { PTRACE_GETREGS, PTRACE_SETREGS, 0, tile_num_regs * 8, > GENERAL_REGS, tile_fill_gregset, tile_store_gregset }, > { 0, 0, 0, -1, -1, NULL, NULL } > }; -- Joel