Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Per Bothner <per@bothner.com>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: Fix PR gdb/265, 64-bit pointers in Java
Date: Wed, 20 Feb 2002 17:30:00 -0000	[thread overview]
Message-ID: <3C744DC0.1090902@bothner.com> (raw)
In-Reply-To: <20020220184414.A7963@nevyn.them.org>

Daniel Jacobowitz wrote:
> Well, it does not silently change the type for conforming input;
> integers will still be marked as integers.  The patch allows us to accept
> things like:
> (gdb) x/i 0x123456789
> 
> which really ought to work.

I'm not 100% convinced, but it's at least reasonable.

> If you disagree with me on that, which you certainly can :), then I
> would prefer to have a flag for parse_number saying it created an
> implicit long and cause errors if the expression being evaluated is a
> method call, etc.  I'm not convinced that's worth the trouble.

An idea: If it overflows, set the type to builtin_type_uint64, or some
similar type, but don't set it to java_type_long.  That way we still
get x/i 0x123456789 to do the expected, but we can (if we wanted to)
catch incorrectly passing 0x123456789 to a Java method.

This is similar to how G++ treets jint (__java_int), as a different
integer type than int, so it can can programs that try to incorrectly
pass an 'int' to a Java method.

If you change it to:

   if (type == java_int_type && n > (ULONGEST)0x80000000)
      type = builtin_type_uint64;

then that would satisfy me.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/


  reply	other threads:[~2002-02-21  1:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-10 21:38 Daniel Jacobowitz
2002-02-11 10:24 ` Tom Tromey
2002-02-11 10:31   ` Daniel Jacobowitz
2002-02-20 14:41 ` Daniel Jacobowitz
2002-02-20 15:04   ` Per Bothner
2002-02-20 15:44     ` Daniel Jacobowitz
2002-02-20 17:30       ` Per Bothner [this message]
2002-02-20 18:05         ` Daniel Jacobowitz
2002-02-20 18:11           ` Per Bothner
2002-02-20 18:55             ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C744DC0.1090902@bothner.com \
    --to=per@bothner.com \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox