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

error: unknown register name 'eax' in asm #72

Open
mpurland opened this issue Mar 31, 2014 · 3 comments
Open

error: unknown register name 'eax' in asm #72

mpurland opened this issue Mar 31, 2014 · 3 comments

Comments

@mpurland
Copy link

DCIntrospect.m Line 624:
Expanded from macro 'DEBUGGER' from the following:

    else if ([string isEqualToString:kDCIntrospectKeysEnterGDB])
    {
        UIView *view = self.currentView;
        view.tag = view.tag;    // suppress the xcode warning about an unused variable.
        NSLog(@"DCIntrospect: access current view using local 'view' variable.");
        DEBUGGER;
        return NO;
    }
@mpurland
Copy link
Author

This seems to fix it:

#if TARGET_CPU_ARM
#define DEBUGSTOP(signal) asm volatile ("mov r0, %0\nmov r1, %1\nmov r12, %2\nswi 128\n" : : "r"(getpid ()), "r"(signal), "r"(37) : "r12", "r0", "r1", "cc");
#define DEBUGGER do { int trapSignal = AmIBeingDebugged () ? SIGINT : SIGSTOP; DEBUGSTOP(trapSignal); if (trapSignal == SIGSTOP) { DEBUGSTOP (SIGINT); } } while (false);
#elif TARGET_CPU_X86 || TARGET_CPU_X86_64
#define DEBUGGER do { int trapSignal = AmIBeingDebugged () ? SIGINT : SIGSTOP; asm volatile ("pushl %0\npushl %1\npush $0\nmovl %2, %%eax\nint $0x80\nadd $12, %%esp" : : "g" (trapSignal), "g" (getpid ()), "n" (37) : "eax", "cc"); } while (false);
#else
#define DEBUGGER
#warning "Debugger disabled."
#endif

@mkoshtenko
Copy link

Is this only iOS 7.1 SDK issue?

AndersDJohnson pushed a commit to AndersDJohnson/DCIntrospect that referenced this issue Jun 17, 2015
@AndersDJohnson
Copy link

@mpurland I've created PR #78 with your fix.

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

No branches or pull requests

3 participants