[Lldb-commits] [lldb] r169316 - /lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp

Jason Molenda jmolenda at apple.com
Tue Dec 4 14:08:50 PST 2012


Author: jmolenda
Date: Tue Dec  4 16:08:50 2012
New Revision: 169316

URL: http://llvm.org/viewvc/llvm-project?rev=169316&view=rev
Log:
Fix comment in ABIMacOSX_i386::RegisterIsCalleeSaved to say that
these are the *non-volatile* registers on Darwin/i386, not the
volatile registers.
Recognize the sp, pc, fp generic reg names as well.

Modified:
    lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp

Modified: lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp?rev=169316&r1=169315&r2=169316&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp Tue Dec  4 16:08:50 2012
@@ -931,19 +931,21 @@
     return RegisterIsCalleeSaved (reg_info);
 }
 
+// v. http://developer.apple.com/library/mac/#documentation/developertools/Conceptual/LowLevelABI/130-IA-32_Function_Calling_Conventions/IA32.html#//apple_ref/doc/uid/TP40002492-SW4
+
 bool
 ABIMacOSX_i386::RegisterIsCalleeSaved (const RegisterInfo *reg_info)
 {
     if (reg_info)
     {
-        // Volatile registers include: ebx, ebp, esi, edi, esp, eip
+        // Saved registers are ebx, ebp, esi, edi, esp, eip
         const char *name = reg_info->name;
         if (name[0] == 'e')
         {
             switch (name[1])
             {
             case 'b': 
-                if (name[2] == 'x') // ebp is volatile in the ABI, but the unwinders can find it
+                if (name[2] == 'x' || name[2] == 'p')
                     return name[3] == '\0';
                 break;
             case 'd':
@@ -960,6 +962,12 @@
                 break;
             }
         }
+        if (name[0] == 's' && name[1] == 'p' && name[2] == '\0')   // sp
+            return true;
+        if (name[0] == 'f' && name[1] == 'p' && name[2] == '\0')   // fp
+            return true;
+        if (name[0] == 'p' && name[1] == 'c' && name[2] == '\0')   // pc
+            return true;
     }
     return false;
 }





More information about the lldb-commits mailing list