public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bryce McKinlay <mckinlay@redhat.com>
To: Ranjit Mathew <rmathew@gmail.com>
Cc: java-patches@gcc.gnu.org
Subject: Re: [MinGW] RFA: Make Stack Traces Work for Interpreted Code on Windows
Date: Tue, 11 Jul 2006 21:34:00 -0000	[thread overview]
Message-ID: <44B4196D.8070808@redhat.com> (raw)
In-Reply-To: <39399b9d0607111134yb7d0314i1e68fa4ef6773b03@mail.gmail.com>

Ranjit Mathew wrote:
>> Note that even then there are some situations (invocation API) where
>> neither _Jv_RunMain or _Jv_ThreadStart will be on the stack.
>
> ...would you happen to know what *will* be there on the call stack
> in this case?

I don't think there is anything guaranteed in the invocation API case. 
For JNI you could look for the various JNI Call* functions, but even 
then it is tricky to figure out whether the frame you are looking at is 
the outermost JNI call.

>> This part of the patch is a bit awkward - duplicating the
>> interpreter-specific code is fragile and will make maintenance more
>> difficult. Couldn't we instead have fallback_backtrace call the real
>> UnwindTraceFn? I believe _Unwind_context is an opaque type, so it should
>> be possible to have fallback_backtrace pass its own data there.
>
> I sort of agree. However, if you look at the code there, it
> calls _Unwind_GetRegionStart() and _Unwind_GetIPInfo() - I'll
> have to #ifdef these out and somehow shoehorn the SJLJ EH
> equivalents in there since the default implementations of
> these functions provided by GCC for SJLJ EH are of no use to
> us.

I think you could just overload them with #defines in backtrace.h? 
Failing that, I think that adding a couple of #ifdef's in UnwindTraceFn 
is not as bad as the code duplication.

>> Hmm. There shouldn't be any problems here (on Linux) - do you have a
>> test case?
>
> Yes. See:
> - ---------------------------- 8< ----------------------------
> 1 public class Ex {
> 2   void snafu( ) throws Exception {
> 3     throw new Exception( "I do not like you!");
> 4   }
> 5   void bar( ) throws Exception {
> 6     snafu( );
> 7   }
> 8   void foo( ) throws Exception {
> 9     bar( );
> 10   }
> 11   public static void main( String[] args) throws Exception {
> 12     new Ex( ).foo( );
> 13   }
> 14 }
> - ---------------------------- 8< ----------------------------

Hmm, ok, I see this too. I've filed a bug:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28352

Bryce

  reply	other threads:[~2006-07-11 21:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-09  9:19 Ranjit Mathew
2006-07-11 17:59 ` Bryce McKinlay
2006-07-11 18:34   ` Ranjit Mathew
2006-07-11 21:34     ` Bryce McKinlay [this message]
2006-07-12 17:28       ` Ranjit Mathew
2006-07-12 20:05         ` Bryce McKinlay
2006-07-14 17:26           ` Ranjit Mathew
2006-07-12 20:10         ` Bryce McKinlay

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=44B4196D.8070808@redhat.com \
    --to=mckinlay@redhat.com \
    --cc=java-patches@gcc.gnu.org \
    --cc=rmathew@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).