public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Alexander Smundak <asmundak@google.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [RFC][PATCH] Allow JIT unwinder provide symbol information
Date: Mon, 02 Jun 2014 01:15:00 -0000	[thread overview]
Message-ID: <CAHQ51u6tgA8d94GXM2bwsq5Fc8waJKb+bnbXoRQyzRp_ubEY7w@mail.gmail.com> (raw)
In-Reply-To: <535FC3AC.6030200@redhat.com>

I have looked again at the possibility of using Frame Filters.
They can be utilized as follows:
1. Use existing JIT reader API to unwind JIT frames.
2. Add methods to the Python Frame object to access frame's
stack pointer and frame pointer (or perhaps provide a method
to access any available register?)
3. Implement FrameDecorator that uses PC/FP/SP to retrieve
frame information (from JVM or whatever). Implement Frame
Filter that returns this FrameDecorator iterator.
4. Decide how to coordinate JIT reader and corresponding
Frame Filter loading.

Better?

On Tue, Apr 29, 2014 at 8:22 AM, Pedro Alves <palves@redhat.com> wrote:
> On 04/26/2014 12:39 AM, Alexander Smundak wrote:
>> On Thu, Apr 24, 2014 at 6:22 AM, Pedro Alves <palves@redhat.com> wrote:
>>> It seems to me that what you want to do here is what Python
>>> frame filters were invented for.  IOW, I think you should
>>> be able to write a frame filter that interacts with the Java
>>> JIT to expose the same info to the user your API extension
>>> is proposing.
>> The patch allows JIT readers to provide the symbol information to GDB.
>> I am not sure how this can be achieved with Python frame filters. IMHO
>> they have different purpose.
>
> But it doesn't actually provide symbol information.  Not in the sense
> that it hooks with GDB's symbol lookup mechanisms.
>
> E.g., the patch does this:
>
> @@ -1201,7 +1229,16 @@ print_frame (struct frame_info *frame, int print_level,
>        args_list_chain = make_cleanup_ui_out_list_begin_end (uiout, "args");
>        TRY_CATCH (e, RETURN_MASK_ERROR)
>   {
> -  print_frame_args (func, frame, numargs, gdb_stdout);
> +  const struct frame_symbol_info *frame_symbol;
> +  frame_symbol = get_frame_symbol_info (frame);
> +
> +  if (frame_symbol != NULL)
> +    {
> +      if (frame_symbol->arguments != NULL)
> + ui_out_text (uiout, frame_symbol->arguments);
> +    }
> +  else
> +    print_frame_args (func, frame, numargs, gdb_stdout);
>
> This is just wrong.  It's printing the frame arguments as
> a single, and simple string.  This simply doesn't work correctly
> with MI frontends.  Or what happens if the user selects
> one of those JIT frames and tries to print one of the arguments?
>
> I really think the way this patch is hooking a bespoke
> function/line/args mechanism into the frame machinery is
> quite hacky as is, sorry.  :-/
>
> --
> Pedro Alves
>

      parent reply	other threads:[~2014-06-02  1:15 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-26 18:36 Sasha Smundak
2014-01-13 18:25 ` Alexander Smundak
2014-02-07 21:54   ` Alexander Smundak
2014-01-13 18:46 ` Doug Evans
2014-01-15  0:39   ` Alexander Smundak
2014-02-11 22:26     ` Doug Evans
2014-02-12  7:50       ` Doug Evans
2014-02-19  3:30         ` Alexander Smundak
2014-02-19  3:50           ` Eli Zaretskii
2014-02-19  5:23             ` Alexander Smundak
2014-04-11 18:47           ` Doug Evans
2014-04-11 18:58           ` Doug Evans
2014-04-21  1:35             ` Alexander Smundak
2014-04-21  7:14               ` Eli Zaretskii
2014-04-21 16:43                 ` Alexander Smundak
2014-02-25  1:19         ` Doug Evans
2014-02-25  3:00           ` Alexander Smundak
2014-03-11  1:46           ` Alexander Smundak
2014-02-08  7:08 ` Yao Qi
2014-02-10  2:16   ` Alexander Smundak
2014-02-11 22:00     ` Doug Evans
2014-04-24 13:22 ` Pedro Alves
2014-04-25 23:40   ` Alexander Smundak
2014-04-29 15:22     ` Pedro Alves
2014-05-02 16:58       ` Alexander Smundak
2014-05-19 21:30         ` Alexander Smundak
2014-05-29  1:07       ` Alexander Smundak
2014-06-02  1:15       ` Alexander Smundak [this message]

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=CAHQ51u6tgA8d94GXM2bwsq5Fc8waJKb+bnbXoRQyzRp_ubEY7w@mail.gmail.com \
    --to=asmundak@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).