public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Storsjö" <martin@martin.st>
To: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] libgcc: Expose the current instruction pointer in SEH _Unwind_Backtrace
Date: Fri, 4 Sep 2020 15:51:32 +0300 (EEST)	[thread overview]
Message-ID: <alpine.DEB.2.23.453.2009041549330.12587@cone.martin.st> (raw)
In-Reply-To: <20200901130126.6266-1-martin@martin.st>

On Tue, 1 Sep 2020, Martin Storsjö wrote:

> Previously, the SEH version of _Unwind_Backtrace did unwind
> the stack and call the provided callback function as intended,
> but there was little the caller could do within the callback to
> actually get any info about that particular level in the unwind.
>
> Set the ra pointer, which is used by _Unwind_GetIP, to allow
> using this function to inspect the state within the callback,
> before calling the callback function.
>
> 2020-09-01  Martin Storsjö  <martin@martin.st>
>
> libgcc/Changelog:
>        * unwind-seh.c (_Unwind_Backtrace): Set the ra pointer before
>        calling the callback.
> ---
> libgcc/unwind-seh.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/libgcc/unwind-seh.c b/libgcc/unwind-seh.c
> index 1a70180cfaa..72473135862 100644
> --- a/libgcc/unwind-seh.c
> +++ b/libgcc/unwind-seh.c
> @@ -466,6 +466,8 @@ _Unwind_Backtrace(_Unwind_Trace_Fn trace,
> 			    &gcc_context.disp->HandlerData,
> 			    &gcc_context.disp->EstablisherFrame, NULL);
>
> +      gcc_context.ra = ms_context.Rip;
> +
>       /* Call trace function.  */
>       if (trace (&gcc_context, trace_argument) != _URC_NO_REASON)
> 	return _URC_FATAL_PHASE1_ERROR;

Ping - any comments on this one?

// Martin

  reply	other threads:[~2020-09-04 12:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01 13:01 Martin Storsjö
2020-09-04 12:51 ` Martin Storsjö [this message]
2020-09-08 12:21 ` [PATCH v2] libgcc: Expose the instruction pointer and stack " Martin Storsjö
2020-11-02 12:05   ` Kai Tietz
2020-11-06  3:27     ` Jeff Law
2020-11-06  6:44       ` Jonathan Yong
2020-11-03  0:32   ` Jonathan Yong
2020-11-06  3:28   ` Jeff Law

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=alpine.DEB.2.23.453.2009041549330.12587@cone.martin.st \
    --to=martin@martin.st \
    --cc=gcc-patches@gcc.gnu.org \
    /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).