Skip to content

Differential Emitter Variable and Struct Support #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: differential-emitter
Choose a base branch
from

Conversation

bartchr808
Copy link
Owner

@bartchr808 bartchr808 commented Jul 22, 2019

Temporary PR while differentiable-emitter branch is merged upstream in apple/swift

@bartchr808 bartchr808 force-pushed the differential-emitter-var-support branch 3 times, most recently from bd7948f to bf55ab1 Compare July 22, 2019 23:29
@bartchr808 bartchr808 force-pushed the differential-emitter-var-support branch from bf55ab1 to 7e22758 Compare July 22, 2019 23:30
@bartchr808 bartchr808 force-pushed the differential-emitter branch 5 times, most recently from 4508b47 to 5a6cdae Compare July 24, 2019 21:33
bartchr808 pushed a commit that referenced this pull request Jul 25, 2019
To display a failure message in the debugger, create a function in the debug info which has the name of the failure message.
The debug location of the trap/cond_fail is then wrapped into this function and the function is declared as "inlined".
In case the debugger stops at the trap instruction, it displays the inline function, which looks like the failure message.
For example:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
    frame #0: 0x0000000100000cbf a.out`testit3(_:) [inlined] Unexpectedly found nil while unwrapping an Optional value at test.swift:14:11 [opt]
   11
   12   @inline(never)
   13   func testit(_ a: Int?) -> Int {
-> 14     return a!
   15   }
   16

This change is currently not enabled by default, but can be enabled with the option "-Xllvm -enable-trap-debug-info".
Enabling this feature needs some changes in lldb. When the lldb part is done, this option can be removed and the feature enabled by default.
bartchr808 pushed a commit that referenced this pull request Jul 25, 2019
To display a failure message in the debugger, create a function in the debug info which has the name of the failure message.
The debug location of the trap/cond_fail is then wrapped into this function and the function is declared as "inlined".
In case the debugger stops at the trap instruction, it displays the inline function, which looks like the failure message.
For example:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
    frame #0: 0x0000000100000cbf a.out`testit3(_:) [inlined] Unexpectedly found nil while unwrapping an Optional value at test.swift:14:11 [opt]
   11
   12   @inline(never)
   13   func testit(_ a: Int?) -> Int {
-> 14     return a!
   15   }
   16

This change is currently not enabled by default, but can be enabled with the option "-Xllvm -enable-trap-debug-info".
Enabling this feature needs some changes in lldb. When the lldb part is done, this option can be removed and the feature enabled by default.
@bartchr808 bartchr808 force-pushed the differential-emitter branch from 52dd673 to 4881e7b Compare July 25, 2019 18:59
bartchr808 added a commit that referenced this pull request Aug 11, 2019
@bartchr808 bartchr808 force-pushed the differential-emitter branch 2 times, most recently from e472a75 to cbd0fa2 Compare August 12, 2019 00:56
@bartchr808 bartchr808 force-pushed the differential-emitter branch from 4e60732 to 1883ac1 Compare August 19, 2019 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant