Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Andy Wingo <wingo@igalia.com>, gdb-patches@sourceware.org
Cc: asmundak@google.com
Subject: Re: [PATCH v2] Add Guile frame unwinder interface
Date: Mon, 09 Mar 2015 15:42:00 -0000	[thread overview]
Message-ID: <54FDBF21.4090400@redhat.com> (raw)
In-Reply-To: <87zj7msbly.fsf@igalia.com>

On 03/09/2015 10:34 AM, Andy Wingo wrote:
> +@var{register} names a register, and should be a string, for example
> +@samp{rip}.  @var{value} is the register value, as a @value{GDBN}
> +value.  Alternately, passing @code{#f} as the value will mark the
> +register as unavailable.

From a glimpse over the code, I think this actually marks it as
"<not saved>" (optimized out), right?  That would be the correct
thing to do.  Marking a register as "<unavailable>" is also possible,
but it is a different thing -- it means the value exists, but gdb
couln't get to it, because e.g., the core file is trimmed, or the
ptrace interface is missing access to some registers.

That said, you may want to consider how you'd expand the API
to allow marking registers as unavailable.

> +@end deffn

> +The first argument should be a <gdb:ephemeral-frame> object.  The second\n\
> +names a register, and should be a string, for example \"rip\".  The\n\
> +third argument is the value, as a GDB value.  Alternately, passing #f\n\
> +as the value will mark the register as unavailable." },

Likewise.

> @@ -99,12 +111,17 @@ frame_unwind_try_unwinder (struct frame_info *this_frame, void **this_cache,
>    volatile struct gdb_exception ex;
>    int res = 0;
>
> +  if (is_unwinding)
> +    internal_error (__FILE__, __LINE__,
> +		    _("Recursion detected while finding an unwinder."));
>    old_cleanup = frame_prepare_for_sniffer (this_frame, unwinder);
>
> +  is_unwinding = 1;
>    TRY_CATCH (ex, RETURN_MASK_ERROR)
>      {
>        res = unwinder->sniffer (unwinder, this_frame, this_cache);
>      }
> +  is_unwinding = 0;
>    if (ex.reason < 0 && ex.error == NOT_AVAILABLE_ERROR)
>      {
>        /* This usually means that not even the PC is available,
> @@ -249,7 +266,8 @@ frame_unwind_got_constant (struct frame_info *frame, int regnum,
>  }

Note that RETURN_MASK_ERROR does not catch all exceptions (notably,
a ctrl-c/QUIT passes right through uncaught).

> +/* Return nonzero if we are in the process of finding an unwinder for a frame.
> +   See the comments in get_current_frame().  */

No ()'s.

> +
> +extern int frame_unwind_is_unwinding (void);

Thanks,
Pedro Alves


  reply	other threads:[~2015-03-09 15:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-05 15:58 [PATCH] " Andy Wingo
2015-03-09 10:34 ` [PATCH v2] " Andy Wingo
2015-03-09 15:42   ` Pedro Alves [this message]
2015-03-09 16:22     ` Eli Zaretskii
2015-03-09 18:54     ` Andy Wingo
2015-03-10  9:03       ` [PATCH v3] " Andy Wingo
2015-03-10 17:48         ` Doug Evans
2015-03-11  9:33           ` Andy Wingo
2015-03-10 15:46       ` [PATCH v2] " Pedro Alves

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=54FDBF21.4090400@redhat.com \
    --to=palves@redhat.com \
    --cc=asmundak@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=wingo@igalia.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