[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-30 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL341125: Add support for SEH unwinding on Windows. (authored by cdavis, committed by ). Repository: rL LLVM https://reviews.llvm.org/D50564 Files: libunwind/trunk/include/__libunwind_config.h

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-30 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision. rnk added a comment. This revision is now accepted and ready to land. In https://reviews.llvm.org/D50564#1211477, @mstorsjo wrote: > Not much more comments from me. The implementation seems reasonable, and > works for one simple test I did (with an earlier revision

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-28 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x added a comment. Ping. Repository: rUNW libunwind https://reviews.llvm.org/D50564 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-24 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x updated this revision to Diff 162509. cdavis5x added a comment. - Move `DISPATCHER_CONTEXT` definition into UnwindCursor.hpp. Repository: rUNW libunwind https://reviews.llvm.org/D50564 Files: include/__libunwind_config.h include/unwind.h src/AddressSpace.hpp

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-24 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x updated this revision to Diff 162441. cdavis5x marked 8 inline comments as done. cdavis5x added a comment. - Remove case we'll never realistically hit. - Add back include I removed earlier. - Add a comment clarifying that some environments use SEH without Windows runtime support.

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-23 Thread Kristina Brooks via Phabricator via cfe-commits
kristina added a comment. I'd say LGTM since it's an introduction of any sort of **runtime** within the LLVM project scope that deals with SEH specifically. So far all the published code is pretty much exclusively related to Clang/LLVM IR and MC support for codegen of SEH related code, but

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-23 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. Not much more comments from me. The implementation seems reasonable, and works for one simple test I did (with an earlier revision of the patch at least), and further refinement can happen in-tree I guess. I'd like to have someone else (@rnk @compnerd?) give it a more

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-23 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x marked 2 inline comments as done. cdavis5x added inline comments. Comment at: src/Unwind-seh.cpp:163 +#ifdef __x86_64__ +unw_get_reg(, UNW_X86_64_RAX, ); +unw_get_reg(, UNW_X86_64_RDX, >private_[3]); mstorsjo wrote: > Without understanding the

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-23 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x updated this revision to Diff 162250. cdavis5x marked 7 inline comments as done. cdavis5x added a comment. - Remove unnecessary code. - Guard against rogue personality functions returning wrong values. - Add a comment clarifying the purpose of the `new_ctx` variable. Repository: rUNW

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-23 Thread Kristina Brooks via Phabricator via cfe-commits
kristina added inline comments. Comment at: src/UnwindCursor.hpp:1801 + if (pc != getLastPC()) { +UNWIND_INFO *xdata = reinterpret_cast(base + unwindEntry->UnwindData); +if (xdata->Flags & (UNW_FLAG_EHANDLER|UNW_FLAG_UHANDLER)) { mstorsjo wrote: > I

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-23 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: src/Unwind-seh.cpp:163 +#ifdef __x86_64__ +unw_get_reg(, UNW_X86_64_RAX, ); +unw_get_reg(, UNW_X86_64_RDX, >private_[3]); Without understanding the code flow completely - is there a risk that this tries to use

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-21 Thread Kristina Brooks via Phabricator via cfe-commits
kristina added a comment. In https://reviews.llvm.org/D50564#1208169, @cdavis5x wrote: > OK, I've removed some of the dependencies on Windows-specific types. The code > in `Unwind-seh.cpp` is very Windows-specific, though, so I left it alone. Much appreciated, thank you for your work. LGTM in

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-21 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x added a comment. OK, I've removed some of the dependencies on Windows-specific types. The code in `Unwind-seh.cpp` is very Windows-specific, though, so I left it alone. Repository: rUNW libunwind https://reviews.llvm.org/D50564 ___

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-21 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x updated this revision to Diff 161807. cdavis5x added a comment. - Make a bit more friendly to non-Windows. - Fix bits that depend on https://reviews.llvm.org/D50413. Repository: rUNW libunwind https://reviews.llvm.org/D50564 Files: include/__libunwind_config.h include/unwind.h

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-21 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x added a comment. In https://reviews.llvm.org/D50564#1207493, @kristina wrote: > In https://reviews.llvm.org/D50564#1206393, @mstorsjo wrote: > > > In https://reviews.llvm.org/D50564#1206370, @cdavis5x wrote: > > > > > In https://reviews.llvm.org/D50564#1206302, @kristina wrote: > > > >

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-21 Thread Kristina Brooks via Phabricator via cfe-commits
kristina added a comment. In https://reviews.llvm.org/D50564#1206393, @mstorsjo wrote: > In https://reviews.llvm.org/D50564#1206370, @cdavis5x wrote: > > > In https://reviews.llvm.org/D50564#1206302, @kristina wrote: > > > > > I'm all for this change except the core issue is that you're using >

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-20 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In https://reviews.llvm.org/D50564#1206370, @cdavis5x wrote: > In https://reviews.llvm.org/D50564#1206302, @kristina wrote: > > > I'm all for this change except the core issue is that you're using > > libunwind as a shim around the actual unwinding API provided by

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-20 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x added a comment. In https://reviews.llvm.org/D50564#1206302, @kristina wrote: > I'm all for this change except the core issue is that you're using libunwind > as a shim around the actual unwinding API provided by Windows. It would be > nice to have something that did not have to do

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-20 Thread Kristina Brooks via Phabricator via cfe-commits
kristina added a comment. I'm all for this change except the core issue is that you're using libunwind as a shim around the actual unwinding API provided by Windows. It would be nice to have something that did not have to do that and was capable of performing unwinding of SEH-style exceptions

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-20 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x added a comment. Ping... Repository: rUNW libunwind https://reviews.llvm.org/D50564 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-17 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x added a comment. Ping. Repository: rUNW libunwind https://reviews.llvm.org/D50564 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-14 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x updated this revision to Diff 160660. cdavis5x added a comment. - Get rid of DISPATCHER_CONTEXT def for ARM. We only support ARM on Win8+ anyway. Repository: rUNW libunwind https://reviews.llvm.org/D50564 Files: include/__libunwind_config.h src/AddressSpace.hpp

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-14 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x added a comment. ...And it turns out Phab marked the comments as done when I uploaded the new change. I didn't know it would do that. That's useful to know. Repository: rUNW libunwind https://reviews.llvm.org/D50564 ___ cfe-commits

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-14 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x added a comment. Marked some comments as done. (Phab won't let me post an empty comment, so...) Repository: rUNW libunwind https://reviews.llvm.org/D50564 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-14 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x updated this revision to Diff 160638. cdavis5x marked 3 inline comments as done. cdavis5x edited the summary of this revision. cdavis5x added a comment. - Update checks for DISPATCHER_CONTEXT definition. - Add link to KJK::Hyperion's articles on SEH. Repository: rUNW libunwind

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-14 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x added a comment. In https://reviews.llvm.org/D50564#1195985, @cdavis5x wrote: > In https://reviews.llvm.org/D50564#1195794, @mstorsjo wrote: > > > > Special thanks to KJK::Hyperion for his excellent series of articles on > > > how EH works on x86-64 Windows. (Seriously, check it out.

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-14 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In https://reviews.llvm.org/D50564#1199285, @rnk wrote: > In https://reviews.llvm.org/D50564#1198996, @cdavis5x wrote: > > > Could somebody verify that the `DISPATCHER_CONTEXT` struct is defined in > > `` for the Win8 and Win10 SDKs? I can't install them right now. > >

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-14 Thread Zachary Turner via Phabricator via cfe-commits
zturner added a comment. In https://reviews.llvm.org/D50564#1199285, @rnk wrote: > In https://reviews.llvm.org/D50564#1198996, @cdavis5x wrote: > > > Could somebody verify that the `DISPATCHER_CONTEXT` struct is defined in > > `` for the Win8 and Win10 SDKs? I can't install them right now. > >

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-14 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment. In https://reviews.llvm.org/D50564#1198996, @cdavis5x wrote: > Could somebody verify that the `DISPATCHER_CONTEXT` struct is defined in > `` for the Win8 and Win10 SDKs? I can't install them right now. I checked both, and they are available, so I think we should guard the

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-14 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x added a comment. Could somebody verify that the `DISPATCHER_CONTEXT` struct is defined in `` for the Win8 and Win10 SDKs? I can't install them right now. Repository: rUNW libunwind https://reviews.llvm.org/D50564 ___ cfe-commits

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-10 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: src/libunwind_ext.h:43 + #if defined(__x86_64__) && !defined(__MINGW64__) +typedef struct _DISPATCHER_CONTEXT { + ULONG64 ControlPc; cdavis5x wrote: > mstorsjo wrote: > > What's this all about? winnt.h (from both MSVC and

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-10 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x added a comment. In https://reviews.llvm.org/D50564#1195794, @mstorsjo wrote: > > Special thanks to KJK::Hyperion for his excellent series of articles on how > > EH works on x86-64 Windows. (Seriously, check it out. It's awesome.) > > Can you give some links to it? A brief googling

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-10 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x updated this revision to Diff 160195. cdavis5x added a comment. - Fix outdated comment. - Make preprocessor conditional more consistent. - Make some private functions used only in a single file static. Repository: rUNW libunwind https://reviews.llvm.org/D50564 Files:

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-10 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x added inline comments. Comment at: src/Unwind-seh.cpp:53 + +/// Exception cleanup routine used by \c __libunwind_frame_consolidate to +/// regain control after handling an SEH exception. mstorsjo wrote: > I don't see any `__libunwind_frame_consolidate`

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-10 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x added inline comments. Comment at: src/libunwind_ext.h:43 + #if defined(__x86_64__) && !defined(__MINGW64__) +typedef struct _DISPATCHER_CONTEXT { + ULONG64 ControlPc; mstorsjo wrote: > What's this all about? winnt.h (from both MSVC and mingw-w64)

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-10 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. > I've tested this implementation on x86-64 to ensure that it works. All > libc++abi tests pass, as do all libc++ exception-related tests. I tested it now as well, and seems to work for my simple testcase. > ARM still remains to be implemented (@compnerd?). LLVM

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-10 Thread Charles Davis via Phabricator via cfe-commits
cdavis5x created this revision. cdavis5x added reviewers: mstorsjo, rnk, compnerd, smeenai. Herald added subscribers: cfe-commits, chrib, christof, kristof.beyls, mgorny. Herald added a reviewer: javed.absar. I've tested this implementation on x86-64 to ensure that it works. All `libc++abi` tests