Skip to content
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

IOS Debugger Break code not compiling under armv7s #1862

Closed
andywyatte17 opened this issue Feb 7, 2020 · 2 comments
Closed

IOS Debugger Break code not compiling under armv7s #1862

andywyatte17 opened this issue Feb 7, 2020 · 2 comments
Labels

Comments

@andywyatte17
Copy link

andywyatte17 commented Feb 7, 2020

I am compiling catch2.11.1 source for IOS. I see that a change has been made in this version around the debugger-break code - #define CATCH_TRAP... etc.

This code doesn't compile for me when using the command such as clang -x c++ -target armv7s-apple-ios9.3 ..., ie when targetting IOS armv7s platform. The error I get compiling in Xcode is:

Cannot determine Thumb instructino size, use inst.n/inst.w instead

The code needs a tweak around the area...

(old code)

#elif defined(CATCH_PLATFORM_IPHONE)
    // use inline assembler
    ...
    #elif defined(__arm__)
        #define CATCH_TRAP() __asm__(".inst 0xe7f001f0")

(new code)

#elif defined(CATCH_PLATFORM_IPHONE)
    // use inline assembler
    ...
    #elif defined(__arm__) && !defined(__thumb__)
      #define CATCH_TRAP() __asm__(".inst 0xe7f001f0")
    #elif defined(__arm__) && defined(__thumb__)
      #define CATCH_TRAP() __asm__(".inst 0xde01")

My choice of code for the second case (.inst 0xde01) was inspired by code at https://github.com/scottt/debugbreak/blob/master/debugbreak.h... however I don't have an easy way to verify this is good (although it does compile).

@horenmar
Copy link
Member

I don't have any iOS device to test this on, but the change seems reasonable enough.

@kaihowl
Copy link

kaihowl commented Mar 20, 2020

I still found this compilation error when trying to update Catch to 2.11.3 in Hunter.
https://travis-ci.com/github/kaihowl/hunter/jobs/300418739
Used compilation:

Used toolchain: iOS 11.4 / Deployment 9.3 / Universal (iphoneos + iphonesimulator) / clang / No code sign / c++14 support

PR currently pending: cpp-pm/hunter#176

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants