From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15935 invoked by alias); 20 Feb 2002 22:41:59 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15828 invoked from network); 20 Feb 2002 22:41:57 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 20 Feb 2002 22:41:57 -0000 Received: from drow by nevyn.them.org with local (Exim 3.34 #1 (Debian)) id 16dfQw-0001UU-00; Wed, 20 Feb 2002 17:41:54 -0500 Date: Wed, 20 Feb 2002 14:41:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com, per@bothner.com Subject: Re: Fix PR gdb/265, 64-bit pointers in Java Message-ID: <20020220174154.A29999@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com, per@bothner.com References: <20020211003818.A26546@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020211003818.A26546@nevyn.them.org> User-Agent: Mutt/1.3.23i X-SW-Source: 2002-02/txt/msg00567.txt.bz2 On Mon, Feb 11, 2002 at 12:38:18AM -0500, Daniel Jacobowitz wrote: > I don't know if Java allows the implicit 0x123456789 -> 0x123456789L > conversion that we all know and love in C, but it certainly behooves us to > act that way on the command line. Per, does this patch look OK? Per never answered me, and I satisfied Tom's objections. I'm committing this as reasonably obvious, in my quest to shrink the number of "I should look at this" PRs in my mailbox. > > -- > Daniel Jacobowitz Carnegie Mellon University > MontaVista Software Debian GNU/Linux Developer > > 2002-02-11 Daniel Jacobowitz > > Fix PR gdb/265 > * jv-exp.y (parse_number): Handle 64-bit integers. > > Index: jv-exp.y > =================================================================== > RCS file: /cvs/src/src/gdb/jv-exp.y,v > retrieving revision 1.3 > diff -u -p -r1.3 jv-exp.y > --- jv-exp.y 2001/03/06 08:21:09 1.3 > +++ jv-exp.y 2002/02/11 05:32:18 > @@ -764,13 +764,13 @@ parse_number (p, len, parsed_float, puti > } > > c = p[len-1]; > + /* A paranoid calculation of (1<<64)-1. */ > limit = (ULONGEST)0xffffffff; > + limit = ((limit << 16) << 16) | limit; > if (c == 'l' || c == 'L') > { > type = java_long_type; > len--; > - /* A paranoid calculation of (1<<64)-1. */ > - limit = ((limit << 16) << 16) | limit; > } > else > { > @@ -797,9 +797,13 @@ parse_number (p, len, parsed_float, puti > n += c; > } > > - putithere->typed_val_int.val = n; > - putithere->typed_val_int.type = type; > - return INTEGER_LITERAL; > + if (type == java_int_type && n > (ULONGEST)0xffffffff) > + type = java_long_type; > + > + putithere->typed_val_int.val = n; > + putithere->typed_val_int.type = type; > + > + return INTEGER_LITERAL; > } > > struct token > -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer