Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Jeff Johnston <jjohnstn@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC]: java inferior function call support
Date: Tue, 23 Mar 2004 19:10:00 -0000	[thread overview]
Message-ID: <20040323191051.GA27837@nevyn.them.org> (raw)
In-Reply-To: <40608A03.1070808@redhat.com>

On Tue, Mar 23, 2004 at 02:03:31PM -0500, Jeff Johnston wrote:
> The following patch adds initial support for simple java inferior calls. 
> Standard calls are either calling a member function of a variable which is 
> a class or a static member function of a class by name.  There are a number 
> of complex scenarios that do not work, but this patch lays the groundwork 
> for supporting them in the future.
> 
> There a few differences between Java and C++ that require handling.  First 
> of all, the Java debug info for a member has a fully qualified name 
> including prototype.  There is an open bugzilla bug against gcj for this, 
> however, I think some rethinking may be required.  In a recent C++ bug, I 
> have found that C++ does not correctly list or properly allow selection of 
> multiple constructors with varying prototypes.  It gets the line numbers 
> and prototypes all wrong. Java, surprisingly, does the right thing.  It 
> lists the correct line numbers and prototypes, and selection works 
> properly.  The fully qualified member name does interfere with tab 
> completion so there is work required.  I have dealt with the gcj problem by 
> parsing out the qualifiers and prototype for a Java member name.
> 
> Another key difference is how the vtable is structured.  For Java, the 
> vtable is an array of function pointers and is located by the first word of 
> every class. It is much more complex for C++ so I have forked the logic 
> that accesses the vtable in gnu-v3-abi.c.
> 
> Ok to commit or comments?

Could we have a test case, also?

The C++ constructors problem you saw is probably related to the
existing bugs with cloned functions, and also to the lousy debug
information that GCC emits for them.

I'm not at all sure about the vtable changes.  They should be
compatible, because gcj does try to follow the C++ ABI.  If you'll send
a testcase, I'll take another look and see what I'm missing.

>         * valarith.c (value_subscript_1): New function that takes
>         c_style as argument.
>         (value_subscript): Change to call value_subscript_1.

Why is this necessary?  You're using a gdb-created type anyway, you
shouldn't need to change anything in value_subscript if you're
subscripting with the right indices.

>         * symtab.c (lookup_symbol): Support Java demangling.

We're trying to move away from this; what breaks without it?


-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


  reply	other threads:[~2004-03-23 19:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-23 19:03 Jeff Johnston
2004-03-23 19:10 ` Daniel Jacobowitz [this message]
2004-03-24 20:38   ` Tom Tromey
2004-03-24 21:33     ` Jim Blandy
     [not found]   ` <4060B653.2050400@redhat.com>
2004-03-25  0:18     ` Daniel Jacobowitz
2004-03-23 19:21 ` David Carlton
2004-03-23 22:35   ` Jeff Johnston
2004-03-23 22:48     ` David Carlton

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=20040323191051.GA27837@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jjohnstn@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