public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Kaushik Srenevasan <kaushik@twitter.com>
Cc: gdb@sourceware.org
Subject: Re: Hotspot JVM GDBJIT plugin
Date: Tue, 05 Jun 2012 14:24:00 -0000	[thread overview]
Message-ID: <CAN9gPaE5UKvtY0ADZB-Jt1oX-AA58-LSaFB53KgEnJx829eGhA@mail.gmail.com> (raw)
In-Reply-To: <CAN_uzpJ6PJHBpuJ_2JO8jwObvH+ck=TsngZ7riEX-KVU7R0tTg@mail.gmail.com>

On Thu, May 24, 2012 at 7:03 AM, Kaushik Srenevasan <kaushik@twitter.com> wrote:
> I've been working on a Hotspot JVM JIT plugin for GDB and noticed that
> there was some interest about this earlier [1]. I currently have mixed
> mode stack traces working [2] and plan to at least add file and
> line number support in the future.

Awesome!  Thanks again for working on this.

> The first of these changes [3] is a simple fix to a crash while trying to
> display the return type of a JIT frame (say on 'finish'.)

Does 'finish' reliably work?  It seems like we'd have to get pretty
lucky (in general) with the VM's implementation of stack frames.  e.g.
if JIT compilation triggered during an interpreted function, I wonder
if it would still return to the same place.

> The second (frame based symbol handler) is a feature added to help GDB
> understand frames created by Hotspot's "template" interpreter. Hotspot
> generates expansions for bytecodes from templates (once) into a buffer
> and uses jump tables to handle dispatch. The same code range thus
> corresponds to different functions, with the only differentiating
> factor being metadata in stack frames. Neither ELF symbol tables nor
> callbacks work in this case and hence the need for frame based symbol
> resolution.
>
> This adds an additional callback that the reader may choose to
> implement to return the name (file path or line number) of the function
> executing in the frame in question. GDB's stack walk code consults this
> handler if it can't find a symbol in its global symbol table.

It would be nice if this code could be shared with the existing inline
frame support, which returns an alternative symbol based on the frame
id.

-- 
Thanks,
Daniel

  parent reply	other threads:[~2012-06-05 14:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-24 11:04 Kaushik Srenevasan
2012-05-25 14:37 ` Tom Tromey
2012-05-25 19:50   ` Kaushik Srenevasan
2012-05-25 21:03     ` Tom Tromey
2012-05-30 18:13       ` Phil Muldoon
2012-05-31 21:05         ` Kaushik Srenevasan
2012-06-05 14:24 ` Daniel Jacobowitz [this message]
2012-06-05 22:21   ` Kaushik Srenevasan
2012-06-06 18:05 ` Tom Tromey

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=CAN9gPaE5UKvtY0ADZB-Jt1oX-AA58-LSaFB53KgEnJx829eGhA@mail.gmail.com \
    --to=drow@false.org \
    --cc=gdb@sourceware.org \
    --cc=kaushik@twitter.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).