summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2012-12-04 22:08:50 +0000
committerJason Molenda <jmolenda@apple.com>2012-12-04 22:08:50 +0000
commit011aea45a9e4b39e89d6ab8068c464bbd6580622 (patch)
treebf7f4f2f4bdaa179daeae0efcc0621da92ffddc9
parent67cb31ebdd665980d101d5219c6804ecde2ae503 (diff)
downloadbcm5719-llvm-011aea45a9e4b39e89d6ab8068c464bbd6580622.tar.gz
bcm5719-llvm-011aea45a9e4b39e89d6ab8068c464bbd6580622.zip
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. llvm-svn: 169316
-rw-r--r--lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
index 11186673233..4201edd1857 100644
--- a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
+++ b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
@@ -931,19 +931,21 @@ ABIMacOSX_i386::RegisterIsVolatile (const RegisterInfo *reg_info)
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 @@ ABIMacOSX_i386::RegisterIsCalleeSaved (const RegisterInfo *reg_info)
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;
}
OpenPOWER on IntegriCloud