[Lldb-commits] [lldb] r169807 - /lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
Jason Molenda
jmolenda at apple.com
Mon Dec 10 17:20:57 PST 2012
Author: jmolenda
Date: Mon Dec 10 19:20:57 2012
New Revision: 169807
URL: http://llvm.org/viewvc/llvm-project?rev=169807&view=rev
Log:
Update comments around ABISysV_x86_64::RegisterIsCalleeSaved to
make it clear that this is the list of callee-saved registers,
add reference to the ABI doc that this comes from.
Modified:
lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
Modified: lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp?rev=169807&r1=169806&r2=169807&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp Mon Dec 10 19:20:57 2012
@@ -1153,14 +1153,23 @@
-
+// See "Register Usage" in the
+// "System V Application Binary Interface"
+// "AMD64 Architecture Processor Supplement"
+// (or "x86-64(tm) Architecture Processor Supplement" in earlier revisions)
+// Edited by Michael Matz, Jan Hubicka, Andreas Jaeger, and Mark Mitchell
+// current version is 0.99.6 released 2012-05-15 at http://x86-64.org/documentation/abi.pdf
bool
ABISysV_x86_64::RegisterIsCalleeSaved (const RegisterInfo *reg_info)
{
if (reg_info)
{
- // Volatile registers include: rbx, rbp, rsp, r12, r13, r14, r15, rip
+ // Preserved registers are :
+ // rbx, rsp, rbp, r12, r13, r14, r15
+ // mxcsr (partially preserved)
+ // x87 control word
+
const char *name = reg_info->name;
if (name[0] == 'r')
{
@@ -1198,6 +1207,12 @@
}
}
+ 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