From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2105 invoked by alias); 13 Jul 2006 04:07:03 -0000 Received: (qmail 2006 invoked by uid 22791); 13 Jul 2006 04:07:02 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Thu, 13 Jul 2006 04:07:00 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1G0sTa-0002C9-FB; Thu, 13 Jul 2006 00:06:58 -0400 Date: Thu, 13 Jul 2006 04:07:00 -0000 From: Daniel Jacobowitz To: zhigang gong Cc: gdb-patches@sources.redhat.com Subject: Re: Wrong data type in function unpack_varlen_hex() Message-ID: <20060713040658.GZ24622@nevyn.them.org> Mail-Followup-To: zhigang gong , gdb-patches@sources.redhat.com References: <40c9f5b20606160558v277bb813r9d5a497c9899432@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40c9f5b20606160558v277bb813r9d5a497c9899432@mail.gmail.com> User-Agent: Mutt/1.5.11+cvs20060403 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-07/txt/msg00141.txt.bz2 On Fri, Jun 16, 2006 at 08:58:33PM +0800, zhigang gong wrote: > Hi, > > I am working on an mips4k platform. When I added hw watchpoint > support for my target board and debug it with gdb. The write > watchpoint works fine, but rwatch and awatch doesn't work. After trace > the source code of the gdb, I found there is a bug in > unpack_varlen_hex. The local variable retval is a signed integer. For > my case, the ULONGEST is a 64bit integer type. So when the > watchpoint's address is 0x8XXXXXXX, the "retval" will be 0x8XXXXXXX, > and pass its value to variable "result", the "result"'s value will be > sign extended to 0xFFFFFFFF8XXXXXXX. Then when i set a rwatch point, > the address matching will fail when the read watchpoint ocurred. > The patch is as belows. And I test it, Thank you for the patch. This is definitely an improvement, so I have committed it. There may be more problems here: addresses on MIPS are generally considered to be signed, so it might be a bug somewhere else in GDB that you're getting 0x000000008xxxxxxx. But, we'll worry about that only if it causes a problem for someone else. -- Daniel Jacobowitz CodeSourcery