From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74692 invoked by alias); 21 Oct 2016 11:23:13 -0000 Mailing-List: contact gnu-gabi-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: gnu-gabi-owner@sourceware.org Received: (qmail 74680 invoked by uid 89); 21 Oct 2016 11:23:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=58, 5,8, uint64, *not X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mx1.redhat.com To: "H.J. Lu" Cc: gnu-gabi@sourceware.org From: Florian Weimer Subject: [PATCH] Make _Unwind_GetIPInfo part of the ABI Message-ID: Date: Fri, 01 Jan 2016 00:00:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------E2C8460F1900053834F69B86" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 21 Oct 2016 11:23:00 +0000 (UTC) X-SW-Source: 2016-q4/txt/msg00012.txt.bz2 This is a multi-part message in MIME format. --------------E2C8460F1900053834F69B86 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 491 Without _Unwind_GetIPInfo, it is not possible to unwind correctly through signal handlers. glibc needs this, otherwise cancellation does not work. The attached patch documents this function and makes it part of the ABI. I tried to explain as best as I could why this function is needed, without talking about exception handler regions. The 32-bit ABI will need a similar change. The second patch is for the Makefile, so that it doesn't ask for input on an error. Thanks, Florian --------------E2C8460F1900053834F69B86 Content-Type: text/x-patch; name="getipinfo.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="getipinfo.patch" Content-length: 2246 diff --git a/libraries.tex b/libraries.tex index 7c5d214..a539e6d 100644 --- a/libraries.tex +++ b/libraries.tex @@ -42,6 +42,7 @@ The unwind library interface consists of at least the following routines:\\ \codeindex{\_Unwind\_GetGR},\\ \codeindex{\_Unwind\_SetGR},\\ \codeindex{\_Unwind\_GetIP},\\ +\codeindex{\_Unwind\_GetIPInfo},\\ \codeindex{\_Unwind\_SetIP},\\ \codeindex{\_Unwind\_GetRegionStart},\\ \codeindex{\_Unwind\_GetLanguageSpecificData},\\ @@ -524,6 +525,41 @@ identified by the unwind context. This value may be outside of the procedure fragment for a function call that is known to not return (such as \code{\_Unwind\_Resume}). +Applications which unwind through asynchronous signals and other +non-call locations should use \code{\_Unwind\_GetIPInfo} below, and +the additional flag that function provides. + +\subsubsection{\code{\_Unwind\_GetIPInfo}} + +\code{ +\begin{tabular}{l} + uint64 \_Unwind\_GetIPInfo\\ + \ \ (struct \_Unwind\_Context *context, int *not\_nested);\\ +\end{tabular} +} + +This function returns the same value as \code{\_Unwind\_GetIP}. In +addition, the argument \code{not\_nested} must not be not null, and +\code{*not\_nested} is updated with a flag which indicates whether +this unwind context refers to a call site which was reached through +stack unwinding. + +If \code{*not\_nested} is false, the application calling +\code{\_Unwind\_GetIPInfo} should assume that the instruction pointer +provided points after a call instruction which has not yet returned. +In general, this means that the application should use the preceding +call instruction as the instruction pointer location of the unwind +context. Typically, this can be approximated by subtracting one from +the returned instruction pointer. + +If \code{*not\_nested} is true, then the instruction pointer does not +refer to an active call site. Usually, this means that the +instruction pointer refers to the point at which an asynchronous +signal arrived. In this case, the application should use the +instruction pointer returned from \code{\_Unwind\_GetIPInfo} as the +instruction pointer location of the unwind context, without +adjustment. + \subsubsection{\code{\_Unwind\_SetIP}} \code{ \begin{tabular}{l} --------------E2C8460F1900053834F69B86 Content-Type: text/x-patch; name="makefile.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="makefile.patch" Content-length: 666 diff --git a/Makefile b/Makefile index 89dfd18..3fc1d65 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ INCLUDES := execution.tex low-level-sys-info.tex development.tex \ ALL_FILES := abi.tex $(INCLUDES) +TEXFLAGS = -interaction=nonstopmode -file-line-error + .PHONY: all abi clean ps pdf update # default @@ -14,14 +16,14 @@ all: abi.ps abi.pdf abi.dvi: $(ALL_FILES) - latex abi + latex $(TEXFLAGS) abi makeindex abi - latex abi - latex abi + latex $(TEXFLAGS) abi + latex $(TEXFLAGS) abi # Depend on abi.dvi to get index. pdf abi.pdf: abi.dvi - pdflatex abi + pdflatex $(TEXFLAGS) abi ps abi.ps: abi.dvi dvips abi.dvi -o abi.ps --------------E2C8460F1900053834F69B86--