This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2] Add Guile frame unwinder interface

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." },


> @@ -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;
>      {
>        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);

Pedro Alves

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]