<div dir="ltr">Hi Abhishek,<div><br></div><div>I don't see any XFAILs removed. What tests does this fix?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 25, 2015 at 10:50 AM, Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: gclayton<br>
Date: Thu Jun 25 12:50:15 2015<br>
New Revision: 240663<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D240663-26view-3Drev&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=A4e5-rVmYN79tDvN3fXaw8x8urg5KaBTOdSq0c4vSMM&s=6kxINu-Tv-c0q6swok13WAgBA0AGGgwzqtl_rr1rMu0&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=240663&view=rev</a><br>
Log:<br>
Submitting patch from Abhishek for:<br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10309&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=A4e5-rVmYN79tDvN3fXaw8x8urg5KaBTOdSq0c4vSMM&s=93QgrqxdJskmLEzP0PUO5JQkYJDcEtVg585lszljjnE&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D10309</a><br>
<br>
<br>
Added:<br>
lldb/trunk/source/Plugins/ABI/SysV-i386/<br>
lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp<br>
lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.h<br>
lldb/trunk/source/Plugins/ABI/SysV-i386/CMakeLists.txt<br>
lldb/trunk/source/Plugins/ABI/SysV-i386/Makefile<br>
Modified:<br>
lldb/trunk/cmake/LLDBDependencies.cmake<br>
lldb/trunk/lib/Makefile<br>
lldb/trunk/lldb.xcodeproj/project.pbxproj<br>
lldb/trunk/source/API/SystemInitializerFull.cpp<br>
lldb/trunk/source/Plugins/ABI/CMakeLists.txt<br>
lldb/trunk/source/Plugins/Makefile<br>
<br>
Modified: lldb/trunk/cmake/LLDBDependencies.cmake<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_cmake_LLDBDependencies.cmake-3Frev-3D240663-26r1-3D240662-26r2-3D240663-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=A4e5-rVmYN79tDvN3fXaw8x8urg5KaBTOdSq0c4vSMM&s=XN2s_2ri8kIcuVCRl7mOS3Gpo3LJ2oGkilBuROLmn6g&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=240663&r1=240662&r2=240663&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/cmake/LLDBDependencies.cmake (original)<br>
+++ lldb/trunk/cmake/LLDBDependencies.cmake Thu Jun 25 12:50:15 2015<br>
@@ -48,6 +48,7 @@ set( LLDB_USED_LIBS<br>
lldbPluginABIMacOSX_i386<br>
lldbPluginABISysV_arm<br>
lldbPluginABISysV_arm64<br>
+ lldbPluginABISysV_i386<br>
lldbPluginABISysV_x86_64<br>
lldbPluginABISysV_hexagon<br>
lldbPluginABISysV_ppc<br>
<br>
Modified: lldb/trunk/lib/Makefile<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_lib_Makefile-3Frev-3D240663-26r1-3D240662-26r2-3D240663-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=A4e5-rVmYN79tDvN3fXaw8x8urg5KaBTOdSq0c4vSMM&s=GrLvPFJ7p5EPahpk_JaOa9i93k7h3fDSQjyK0VaOVmY&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/lib/Makefile?rev=240663&r1=240662&r2=240663&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/lib/Makefile (original)<br>
+++ lldb/trunk/lib/Makefile Thu Jun 25 12:50:15 2015<br>
@@ -41,6 +41,7 @@ USEDLIBS = lldbAPI.a \<br>
lldbPluginABISysV_ppc64.a \<br>
lldbPluginABISysV_mips.a \<br>
lldbPluginABISysV_mips64.a \<br>
+ lldbPluginABISysV_i386.a \<br>
lldbPluginABISysV_x86_64.a \<br>
lldbPluginABISysV_hexagon.a \<br>
lldbPluginDisassemblerLLVM.a \<br>
@@ -50,8 +51,8 @@ USEDLIBS = lldbAPI.a \<br>
lldbPluginDynamicLoaderMacOSX.a \<br>
lldbPluginEmulateInstructionARM.a \<br>
lldbPluginEmulateInstructionARM64.a \<br>
- lldbPluginEmulateInstructionMIPS.a \<br>
- lldbPluginEmulateInstructionMIPS64.a \<br>
+ lldbPluginEmulateInstructionMIPS.a \<br>
+ lldbPluginEmulateInstructionMIPS64.a \<br>
lldbPluginInstrumentationRuntimeAddressSanitizer.a \<br>
lldbPluginLanguageRuntimeCPlusPlusItaniumABI.a \<br>
lldbPluginLanguageRuntimeObjCAppleObjCRuntime.a \<br>
<br>
Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_lldb.xcodeproj_project.pbxproj-3Frev-3D240663-26r1-3D240662-26r2-3D240663-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=A4e5-rVmYN79tDvN3fXaw8x8urg5KaBTOdSq0c4vSMM&s=IWwxl2NnPODlc-87IcpscF_PWE1k5kak_nejH-oEByw&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=240663&r1=240662&r2=240663&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)<br>
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Jun 25 12:50:15 2015<br>
@@ -638,6 +638,10 @@<br>
26BC17B218C7F4CB00D2196D /* ThreadElfCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 26BC17A918C7F4CB00D2196D /* ThreadElfCore.h */; };<br>
26BCFC521368AE38006DC050 /* OptionGroupFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BCFC511368AE38006DC050 /* OptionGroupFormat.cpp */; };<br>
26BD407F135D2AE000237D80 /* FileLineResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BD407E135D2ADF00237D80 /* FileLineResolver.cpp */; };<br>
+ 26BF51F31B3C754400016294 /* ABISysV_hexagon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BF51EA1B3C754400016294 /* ABISysV_hexagon.cpp */; };<br>
+ 26BF51F41B3C754400016294 /* ABISysV_hexagon.h in Headers */ = {isa = PBXBuildFile; fileRef = 26BF51EB1B3C754400016294 /* ABISysV_hexagon.h */; };<br>
+ 26BF51F61B3C754400016294 /* ABISysV_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BF51EF1B3C754400016294 /* ABISysV_i386.cpp */; };<br>
+ 26BF51F71B3C754400016294 /* ABISysV_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 26BF51F01B3C754400016294 /* ABISysV_i386.h */; };<br>
26C72C94124322890068DC16 /* SBStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 26C72C93124322890068DC16 /* SBStream.h */; settings = {ATTRIBUTES = (Public, ); }; };<br>
26C72C961243229A0068DC16 /* SBStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C72C951243229A0068DC16 /* SBStream.cpp */; };<br>
26CA97A1172B1FD5005DC71B /* RegisterContextThreadMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26CA979F172B1FD5005DC71B /* RegisterContextThreadMemory.cpp */; };<br>
@@ -2111,6 +2115,10 @@<br>
26BCFC541368B4B8006DC050 /* OptionGroupOutputFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupOutputFile.h; path = include/lldb/Interpreter/OptionGroupOutputFile.h; sourceTree = "<group>"; };<br>
26BD407D135D2AC400237D80 /* FileLineResolver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FileLineResolver.h; path = include/lldb/Core/FileLineResolver.h; sourceTree = "<group>"; };<br>
26BD407E135D2ADF00237D80 /* FileLineResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileLineResolver.cpp; path = source/Core/FileLineResolver.cpp; sourceTree = "<group>"; };<br>
+ 26BF51EA1B3C754400016294 /* ABISysV_hexagon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABISysV_hexagon.cpp; sourceTree = "<group>"; };<br>
+ 26BF51EB1B3C754400016294 /* ABISysV_hexagon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABISysV_hexagon.h; sourceTree = "<group>"; };<br>
+ 26BF51EF1B3C754400016294 /* ABISysV_i386.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABISysV_i386.cpp; sourceTree = "<group>"; };<br>
+ 26BF51F01B3C754400016294 /* ABISysV_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABISysV_i386.h; sourceTree = "<group>"; };<br>
26C5577B132575AD008FD8FE /* PlatformMacOSX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformMacOSX.cpp; sourceTree = "<group>"; };<br>
26C5577C132575AD008FD8FE /* PlatformMacOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformMacOSX.h; sourceTree = "<group>"; };<br>
26C6886D137880B900407EDF /* RegisterValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RegisterValue.h; path = include/lldb/Core/RegisterValue.h; sourceTree = "<group>"; };<br>
@@ -4751,6 +4759,24 @@<br>
name = MacOSX;<br>
sourceTree = "<group>";<br>
};<br>
+ 26BF51E91B3C754400016294 /* SysV-hexagon */ = {<br>
+ isa = PBXGroup;<br>
+ children = (<br>
+ 26BF51EA1B3C754400016294 /* ABISysV_hexagon.cpp */,<br>
+ 26BF51EB1B3C754400016294 /* ABISysV_hexagon.h */,<br>
+ );<br>
+ path = "SysV-hexagon";<br>
+ sourceTree = "<group>";<br>
+ };<br>
+ 26BF51EE1B3C754400016294 /* SysV-i386 */ = {<br>
+ isa = PBXGroup;<br>
+ children = (<br>
+ 26BF51EF1B3C754400016294 /* ABISysV_i386.cpp */,<br>
+ 26BF51F01B3C754400016294 /* ABISysV_i386.h */,<br>
+ );<br>
+ path = "SysV-i386";<br>
+ sourceTree = "<group>";<br>
+ };<br>
26C5577E132575B6008FD8FE /* Platform */ = {<br>
isa = PBXGroup;<br>
children = (<br>
@@ -4813,6 +4839,8 @@<br>
26DB3E0E1379E7AD0080DC73 /* MacOSX-i386 */,<br>
AF20F7621AF18F5E00751A6E /* SysV-arm */,<br>
AF20F7631AF18F6800751A6E /* SysV-arm64 */,<br>
+ 26BF51E91B3C754400016294 /* SysV-hexagon */,<br>
+ 26BF51EE1B3C754400016294 /* SysV-i386 */,<br>
9694FA6E1B32AA35005EBB16 /* SysV-mips */,<br>
263641141B34AEE200145B2F /* SysV-mips64 */,<br>
AF77E08B1A033C3E0096C0EA /* SysV-ppc */,<br>
@@ -5538,6 +5566,7 @@<br>
26474CCC18D0CB5B0073DEBA /* RegisterContextPOSIX_mips64.h in Headers */,<br>
26474CBD18D0CB2D0073DEBA /* RegisterContextMach_arm.h in Headers */,<br>
260CC63415D04377002BF2E0 /* OptionValueFileSpec.h in Headers */,<br>
+ 26BF51F41B3C754400016294 /* ABISysV_hexagon.h in Headers */,<br>
26CFDCA11861638D000E63E5 /* Editline.h in Headers */,<br>
26BC17B018C7F4CB00D2196D /* RegisterContextPOSIXCore_x86_64.h in Headers */,<br>
6D55BAF01A8CD0BD00A70529 /* PlatformAndroidRemoteGDBServer.h in Headers */,<br>
@@ -5564,6 +5593,7 @@<br>
256CBDBD1ADD107200BC6CDC /* RegisterContextLinux_mips64.h in Headers */,<br>
AF061F8C182C980000B6A19C /* HistoryUnwind.h in Headers */,<br>
264A58EC1A7DBC8C00A6B1B0 /* OptionValueFormatEntity.h in Headers */,<br>
+ 26BF51F71B3C754400016294 /* ABISysV_i386.h in Headers */,<br>
260CC63815D04377002BF2E0 /* OptionValueString.h in Headers */,<br>
260CC63915D04377002BF2E0 /* OptionValueUInt64.h in Headers */,<br>
256CBDC11ADD11C000BC6CDC /* RegisterContextPOSIX_arm.h in Headers */,<br>
@@ -6300,6 +6330,7 @@<br>
AF9B8F33182DB52900DA866F /* SystemRuntimeMacOSX.cpp in Sources */,<br>
2689008113353E2200698AC0 /* CommandObject.cpp in Sources */,<br>
3F8160A61AB9F7DD001DA9DF /* Logging.cpp in Sources */,<br>
+ 26BF51F61B3C754400016294 /* ABISysV_i386.cpp in Sources */,<br>
2689008313353E2200698AC0 /* CommandObjectMultiword.cpp in Sources */,<br>
2689008413353E2200698AC0 /* CommandObjectRegexCommand.cpp in Sources */,<br>
2689008513353E2200698AC0 /* CommandReturnObject.cpp in Sources */,<br>
@@ -6425,6 +6456,7 @@<br>
268900FA13353E6F00698AC0 /* ThreadList.cpp in Sources */,<br>
268900FB13353E6F00698AC0 /* ThreadPlan.cpp in Sources */,<br>
256CBDBC1ADD107200BC6CDC /* RegisterContextLinux_mips64.cpp in Sources */,<br>
+ 26BF51F31B3C754400016294 /* ABISysV_hexagon.cpp in Sources */,<br>
232CB619191E00CD00EF39FC /* NativeProcessProtocol.cpp in Sources */,<br>
8CF02AEF19DD16B100B14BE0 /* InstrumentationRuntimeStopInfo.cpp in Sources */,<br>
268900FC13353E6F00698AC0 /* ThreadPlanBase.cpp in Sources */,<br>
<br>
Modified: lldb/trunk/source/API/SystemInitializerFull.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_API_SystemInitializerFull.cpp-3Frev-3D240663-26r1-3D240662-26r2-3D240663-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=A4e5-rVmYN79tDvN3fXaw8x8urg5KaBTOdSq0c4vSMM&s=TR0bWI7KXL3QasNibXnvHq-7oTF2qDkBiA51_wCLztY&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SystemInitializerFull.cpp?rev=240663&r1=240662&r2=240663&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/API/SystemInitializerFull.cpp (original)<br>
+++ lldb/trunk/source/API/SystemInitializerFull.cpp Thu Jun 25 12:50:15 2015<br>
@@ -19,6 +19,7 @@<br>
#include "Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h"<br>
#include "Plugins/ABI/SysV-arm/ABISysV_arm.h"<br>
#include "Plugins/ABI/SysV-arm64/ABISysV_arm64.h"<br>
+#include "Plugins/ABI/SysV-i386/ABISysV_i386.h"<br>
#include "Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h"<br>
#include "Plugins/ABI/SysV-ppc/ABISysV_ppc.h"<br>
#include "Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h"<br>
@@ -236,6 +237,7 @@ SystemInitializerFull::Initialize()<br>
ABIMacOSX_arm64::Initialize();<br>
ABISysV_arm::Initialize();<br>
ABISysV_arm64::Initialize();<br>
+ ABISysV_i386::Initialize();<br>
ABISysV_x86_64::Initialize();<br>
ABISysV_ppc::Initialize();<br>
ABISysV_ppc64::Initialize();<br>
@@ -337,6 +339,7 @@ SystemInitializerFull::Terminate()<br>
ABIMacOSX_arm64::Terminate();<br>
ABISysV_arm::Terminate();<br>
ABISysV_arm64::Terminate();<br>
+ ABISysV_i386::Terminate();<br>
ABISysV_x86_64::Terminate();<br>
ABISysV_ppc::Terminate();<br>
ABISysV_ppc64::Terminate();<br>
<br>
Modified: lldb/trunk/source/Plugins/ABI/CMakeLists.txt<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_ABI_CMakeLists.txt-3Frev-3D240663-26r1-3D240662-26r2-3D240663-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=A4e5-rVmYN79tDvN3fXaw8x8urg5KaBTOdSq0c4vSMM&s=EvVwu7kgtvSDjF5Su0ZKwhY6emN6-nx6Ot4_YraH1Q0&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/CMakeLists.txt?rev=240663&r1=240662&r2=240663&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/ABI/CMakeLists.txt (original)<br>
+++ lldb/trunk/source/Plugins/ABI/CMakeLists.txt Thu Jun 25 12:50:15 2015<br>
@@ -5,6 +5,7 @@ add_subdirectory(SysV-ppc)<br>
add_subdirectory(SysV-ppc64)<br>
add_subdirectory(SysV-mips)<br>
add_subdirectory(SysV-mips64)<br>
+add_subdirectory(SysV-i386)<br>
add_subdirectory(SysV-x86_64)<br>
add_subdirectory(MacOSX-i386)<br>
add_subdirectory(MacOSX-arm)<br>
<br>
Added: lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_ABI_SysV-2Di386_ABISysV-5Fi386.cpp-3Frev-3D240663-26view-3Dauto&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=A4e5-rVmYN79tDvN3fXaw8x8urg5KaBTOdSq0c4vSMM&s=HxnuXYVGwYWdqjxqZ8jBpTdK1mVYdcXI5j9728_OPtM&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp?rev=240663&view=auto</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp (added)<br>
+++ lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp Thu Jun 25 12:50:15 2015<br>
@@ -0,0 +1,815 @@<br>
+//===----------------------- ABISysV_i386.cpp -------------------*- C++ -*-===//<br>
+//<br>
+// The LLVM Compiler Infrastructure<br>
+//<br>
+// This file is distributed under the University of Illinois Open Source License.<br>
+// See LICENSE.TXT for details.<br>
+//===----------------------------------------------------------------------===//<br>
+<br>
+#include "ABISysV_i386.h"<br>
+<br>
+#include "lldb/Core/ConstString.h"<br>
+#include "lldb/Core/DataExtractor.h"<br>
+#include "lldb/Core/Error.h"<br>
+#include "lldb/Core/Log.h"<br>
+#include "lldb/Core/Module.h"<br>
+#include "lldb/Core/PluginManager.h"<br>
+#include "lldb/Core/RegisterValue.h"<br>
+#include "lldb/Core/Value.h"<br>
+#include "lldb/Core/ValueObjectConstResult.h"<br>
+#include "lldb/Core/ValueObjectRegister.h"<br>
+#include "lldb/Core/ValueObjectMemory.h"<br>
+#include "lldb/Symbol/ClangASTContext.h"<br>
+#include "lldb/Symbol/UnwindPlan.h"<br>
+#include "lldb/Target/Target.h"<br>
+#include "lldb/Target/Process.h"<br>
+#include "lldb/Target/RegisterContext.h"<br>
+#include "lldb/Target/StackFrame.h"<br>
+#include "lldb/Target/Thread.h"<br>
+<br>
+#include "llvm/ADT/STLExtras.h"<br>
+#include "llvm/ADT/Triple.h"<br>
+<br>
+using namespace lldb;<br>
+using namespace lldb_private;<br>
+<br>
+<br>
+<br>
+// This source file uses the following document as a reference:<br>
+//====================================================================<br>
+// System V Application Binary Interface<br>
+// Intel386 Architecture Processor Supplement, Version 1.0<br>
+// Edited by<br>
+// H.J. Lu, David L Kreitzer, Milind Girkar, Zia Ansari<br>
+//<br>
+// (Based on<br>
+// System V Application Binary Interface,<br>
+// AMD64 Architecture Processor Supplement,<br>
+// Edited by<br>
+// H.J. Lu, Michael Matz, Milind Girkar, Jan Hubicka,<br>
+// Andreas Jaeger, Mark Mitchell)<br>
+//<br>
+// February 3, 2015<br>
+//====================================================================<br>
+<br>
+<br>
+<br>
+// DWARF Register Number Mapping<br>
+// See Table 2.14 of the reference document (specified on top of this file)<br>
+// Comment: Table 2.14 is followed till 'mm' entries.<br>
+// After that, all entries are ignored here.<br>
+<br>
+enum gcc_dwarf_regnums<br>
+{<br>
+ gcc_dwarf_eax = 0,<br>
+ gcc_dwarf_ecx,<br>
+ gcc_dwarf_edx,<br>
+ gcc_dwarf_ebx,<br>
+ gcc_dwarf_esp,<br>
+ gcc_dwarf_ebp,<br>
+ gcc_dwarf_esi,<br>
+ gcc_dwarf_edi,<br>
+ gcc_dwarf_eip,<br>
+ gcc_dwarf_eflags,<br>
+<br>
+ gcc_dwarf_st0 = 11,<br>
+ gcc_dwarf_st1,<br>
+ gcc_dwarf_st2,<br>
+ gcc_dwarf_st3,<br>
+ gcc_dwarf_st4,<br>
+ gcc_dwarf_st5,<br>
+ gcc_dwarf_st6,<br>
+ gcc_dwarf_st7,<br>
+<br>
+ gcc_dwarf_xmm0 = 21,<br>
+ gcc_dwarf_xmm1,<br>
+ gcc_dwarf_xmm2,<br>
+ gcc_dwarf_xmm3,<br>
+ gcc_dwarf_xmm4,<br>
+ gcc_dwarf_xmm5,<br>
+ gcc_dwarf_xmm6,<br>
+ gcc_dwarf_xmm7,<br>
+ gcc_dwarf_ymm0 = gcc_dwarf_xmm0,<br>
+ gcc_dwarf_ymm1 = gcc_dwarf_xmm1,<br>
+ gcc_dwarf_ymm2 = gcc_dwarf_xmm2,<br>
+ gcc_dwarf_ymm3 = gcc_dwarf_xmm3,<br>
+ gcc_dwarf_ymm4 = gcc_dwarf_xmm4,<br>
+ gcc_dwarf_ymm5 = gcc_dwarf_xmm5,<br>
+ gcc_dwarf_ymm6 = gcc_dwarf_xmm6,<br>
+ gcc_dwarf_ymm7 = gcc_dwarf_xmm7,<br>
+<br>
+ gcc_dwarf_mm0 = 29,<br>
+ gcc_dwarf_mm1,<br>
+ gcc_dwarf_mm2,<br>
+ gcc_dwarf_mm3,<br>
+ gcc_dwarf_mm4,<br>
+ gcc_dwarf_mm5,<br>
+ gcc_dwarf_mm6,<br>
+ gcc_dwarf_mm7<br>
+};<br>
+<br>
+<br>
+enum gdb_regnums<br>
+{<br>
+ gdb_eax = 0,<br>
+ gdb_ecx = 1,<br>
+ gdb_edx = 2,<br>
+ gdb_ebx = 3,<br>
+ gdb_esp = 4,<br>
+ gdb_ebp = 5,<br>
+ gdb_esi = 6,<br>
+ gdb_edi = 7,<br>
+ gdb_eip = 8,<br>
+ gdb_eflags = 9,<br>
+ gdb_cs = 10,<br>
+ gdb_ss = 11,<br>
+ gdb_ds = 12,<br>
+ gdb_es = 13,<br>
+ gdb_fs = 14,<br>
+ gdb_gs = 15,<br>
+ gdb_st0 = 16,<br>
+ gdb_st1 = 17,<br>
+ gdb_st2 = 18,<br>
+ gdb_st3 = 19,<br>
+ gdb_st4 = 20,<br>
+ gdb_st5 = 21,<br>
+ gdb_st6 = 22,<br>
+ gdb_st7 = 23,<br>
+ gdb_fctrl = 24, gdb_fcw = gdb_fctrl,<br>
+ gdb_fstat = 25, gdb_fsw = gdb_fstat,<br>
+ gdb_ftag = 26, gdb_ftw = gdb_ftag,<br>
+ gdb_fiseg = 27, gdb_fpu_cs = gdb_fiseg,<br>
+ gdb_fioff = 28, gdb_ip = gdb_fioff,<br>
+ gdb_foseg = 29, gdb_fpu_ds = gdb_foseg,<br>
+ gdb_fooff = 30, gdb_dp = gdb_fooff,<br>
+ gdb_fop = 31,<br>
+ gdb_xmm0 = 32,<br>
+ gdb_xmm1 = 33,<br>
+ gdb_xmm2 = 34,<br>
+ gdb_xmm3 = 35,<br>
+ gdb_xmm4 = 36,<br>
+ gdb_xmm5 = 37,<br>
+ gdb_xmm6 = 38,<br>
+ gdb_xmm7 = 39,<br>
+ gdb_mxcsr = 40,<br>
+ gdb_mm0 = 41,<br>
+ gdb_mm1 = 42,<br>
+ gdb_mm2 = 43,<br>
+ gdb_mm3 = 44,<br>
+ gdb_mm4 = 45,<br>
+ gdb_mm5 = 46,<br>
+ gdb_mm6 = 47,<br>
+ gdb_mm7 = 48,<br>
+ gdb_ymm0 = gdb_xmm0,<br>
+ gdb_ymm1 = gdb_xmm1,<br>
+ gdb_ymm2 = gdb_xmm2,<br>
+ gdb_ymm3 = gdb_xmm3,<br>
+ gdb_ymm4 = gdb_xmm4,<br>
+ gdb_ymm5 = gdb_xmm5,<br>
+ gdb_ymm6 = gdb_xmm6,<br>
+ gdb_ymm7 = gdb_xmm7<br>
+};<br>
+<br>
+<br>
+static RegisterInfo g_register_infos[] =<br>
+{<br>
+ // NAME ALT SZ OFF ENCODING FORMAT COMPILER DWARF GENERIC GDB LLDB NATIVE VALUE REGS INVALIDATE REGS<br>
+ // ====== ======= == === ============= ============ ===================== ===================== ============================ ==================== ====================== ========== ===============<br>
+ { "eax", nullptr, 4, 0, eEncodingUint , eFormatHex , { gcc_dwarf_eax , gcc_dwarf_eax , LLDB_INVALID_REGNUM , gdb_eax , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "ebx" , nullptr, 4, 0, eEncodingUint , eFormatHex , { gcc_dwarf_ebx , gcc_dwarf_ebx , LLDB_INVALID_REGNUM , gdb_ebx , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "ecx" , nullptr, 4, 0, eEncodingUint , eFormatHex , { gcc_dwarf_ecx , gcc_dwarf_ecx , LLDB_REGNUM_GENERIC_ARG4 , gdb_ecx , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "edx" , nullptr, 4, 0, eEncodingUint , eFormatHex , { gcc_dwarf_edx , gcc_dwarf_edx , LLDB_REGNUM_GENERIC_ARG3 , gdb_edx , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "esi" , nullptr, 4, 0, eEncodingUint , eFormatHex , { gcc_dwarf_esi , gcc_dwarf_esi , LLDB_REGNUM_GENERIC_ARG2 , gdb_esi , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "edi" , nullptr, 4, 0, eEncodingUint , eFormatHex , { gcc_dwarf_edi , gcc_dwarf_edi , LLDB_REGNUM_GENERIC_ARG1 , gdb_edi , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "ebp" , "fp", 4, 0, eEncodingUint , eFormatHex , { gcc_dwarf_ebp , gcc_dwarf_ebp , LLDB_REGNUM_GENERIC_FP , gdb_ebp , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "esp" , "sp", 4, 0, eEncodingUint , eFormatHex , { gcc_dwarf_esp , gcc_dwarf_esp , LLDB_REGNUM_GENERIC_SP , gdb_esp , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "eip" , "pc", 4, 0, eEncodingUint , eFormatHex , { gcc_dwarf_eip , gcc_dwarf_eip , LLDB_REGNUM_GENERIC_PC , gdb_eip , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "eflags", nullptr, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_REGNUM_GENERIC_FLAGS , gdb_eflags , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "cs" , nullptr, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , gdb_cs , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "ss" , nullptr, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , gdb_ss , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "ds" , nullptr, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , gdb_ds , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "es" , nullptr, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , gdb_es , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "fs" , nullptr, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , gdb_fs , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "gs" , nullptr, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , gdb_gs , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "st0" , nullptr, 10, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_st0 , LLDB_INVALID_REGNUM , gdb_st0 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "st1" , nullptr, 10, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_st1 , LLDB_INVALID_REGNUM , gdb_st1 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "st2" , nullptr, 10, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_st2 , LLDB_INVALID_REGNUM , gdb_st2 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "st3" , nullptr, 10, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_st3 , LLDB_INVALID_REGNUM , gdb_st3 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "st4" , nullptr, 10, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_st4 , LLDB_INVALID_REGNUM , gdb_st4 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "st5" , nullptr, 10, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_st5 , LLDB_INVALID_REGNUM , gdb_st5 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "st6" , nullptr, 10, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_st6 , LLDB_INVALID_REGNUM , gdb_st6 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "st7" , nullptr, 10, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_st7 , LLDB_INVALID_REGNUM , gdb_st7 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "fctrl" , nullptr, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , gdb_fctrl , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "fstat" , nullptr, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , gdb_fstat , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "ftag" , nullptr, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , gdb_ftag , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "fiseg" , nullptr, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , gdb_fiseg , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "fioff" , nullptr, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , gdb_fioff , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "foseg" , nullptr, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , gdb_foseg , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "fooff" , nullptr, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , gdb_fooff , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "fop" , nullptr, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , gdb_fop , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "xmm0" , nullptr, 16, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_xmm0 , LLDB_INVALID_REGNUM , gdb_xmm0 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "xmm1" , nullptr, 16, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_xmm1 , LLDB_INVALID_REGNUM , gdb_xmm1 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "xmm2" , nullptr, 16, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_xmm2 , LLDB_INVALID_REGNUM , gdb_xmm2 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "xmm3" , nullptr, 16, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_xmm3 , LLDB_INVALID_REGNUM , gdb_xmm3 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "xmm4" , nullptr, 16, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_xmm4 , LLDB_INVALID_REGNUM , gdb_xmm4 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "xmm5" , nullptr, 16, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_xmm5 , LLDB_INVALID_REGNUM , gdb_xmm5 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "xmm6" , nullptr, 16, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_xmm6 , LLDB_INVALID_REGNUM , gdb_xmm6 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "xmm7" , nullptr, 16, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_xmm7 , LLDB_INVALID_REGNUM , gdb_xmm7 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "mxcsr" , nullptr, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , gdb_mxcsr , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "ymm0" , nullptr, 32, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_ymm0 , LLDB_INVALID_REGNUM , gdb_ymm0 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "ymm1" , nullptr, 32, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_ymm1 , LLDB_INVALID_REGNUM , gdb_ymm1 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "ymm2" , nullptr, 32, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_ymm2 , LLDB_INVALID_REGNUM , gdb_ymm2 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "ymm3" , nullptr, 32, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_ymm3 , LLDB_INVALID_REGNUM , gdb_ymm3 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "ymm4" , nullptr, 32, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_ymm4 , LLDB_INVALID_REGNUM , gdb_ymm4 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "ymm5" , nullptr, 32, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_ymm5 , LLDB_INVALID_REGNUM , gdb_ymm5 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "ymm6" , nullptr, 32, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_ymm6 , LLDB_INVALID_REGNUM , gdb_ymm6 , LLDB_INVALID_REGNUM }, nullptr, nullptr},<br>
+ { "ymm7" , nullptr, 32, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM , gcc_dwarf_ymm7 , LLDB_INVALID_REGNUM , gdb_ymm7 , LLDB_INVALID_REGNUM }, nullptr, nullptr}<br>
+};<br>
+<br>
+static const uint32_t k_num_register_infos = llvm::array_lengthof(g_register_infos);<br>
+static bool g_register_info_names_constified = false;<br>
+<br>
+const lldb_private::RegisterInfo *<br>
+ABISysV_i386::GetRegisterInfoArray (uint32_t &count)<br>
+{<br>
+ // Make the C-string names and alt_names for the register infos into const<br>
+ // C-string values by having the ConstString unique the names in the global<br>
+ // constant C-string pool.<br>
+ if (!g_register_info_names_constified)<br>
+ {<br>
+ g_register_info_names_constified = true;<br>
+ for (uint32_t i=0; i<k_num_register_infos; ++i)<br>
+ {<br>
+ if (g_register_infos[i].name)<br>
+ g_register_infos[i].name = ConstString(g_register_infos[i].name).GetCString();<br>
+ if (g_register_infos[i].alt_name)<br>
+ g_register_infos[i].alt_name = ConstString(g_register_infos[i].alt_name).GetCString();<br>
+ }<br>
+ }<br>
+ count = k_num_register_infos;<br>
+ return g_register_infos;<br>
+}<br>
+<br>
+<br>
+//------------------------------------------------------------------<br>
+// Static Functions<br>
+//------------------------------------------------------------------<br>
+ABISP<br>
+ABISysV_i386::CreateInstance (const ArchSpec &arch)<br>
+{<br>
+ static ABISP g_abi_sp;<br>
+ if ((arch.GetTriple().getArch() == llvm::Triple::x86) &&<br>
+ arch.GetTriple().isOSLinux())<br>
+ {<br>
+ if (!g_abi_sp)<br>
+ g_abi_sp.reset (new ABISysV_i386);<br>
+ return g_abi_sp;<br>
+ }<br>
+ return ABISP();<br>
+}<br>
+<br>
+bool<br>
+ABISysV_i386::PrepareTrivialCall (Thread &thread,<br>
+ addr_t sp,<br>
+ addr_t func_addr,<br>
+ addr_t return_addr,<br>
+ llvm::ArrayRef<addr_t> args) const<br>
+{<br>
+ RegisterContext *reg_ctx = thread.GetRegisterContext().get();<br>
+<br>
+ if (!reg_ctx)<br>
+ return false;<br>
+<br>
+ uint32_t pc_reg_num = reg_ctx->ConvertRegisterKindToRegisterNumber (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC);<br>
+ uint32_t sp_reg_num = reg_ctx->ConvertRegisterKindToRegisterNumber (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP);<br>
+<br>
+ // While using register info to write a register value to memory, the register info<br>
+ // just needs to have the correct size of a 32 bit register, the actual register it<br>
+ // pertains to is not important, just the size needs to be correct.<br>
+ // "eax" is used here for this purpose.<br>
+ const RegisterInfo *reg_info_32 = reg_ctx->GetRegisterInfoByName("eax");<br>
+ if (!reg_info_32)<br>
+ return false; // TODO this should actually never happen<br>
+<br>
+ Error error;<br>
+ RegisterValue reg_value;<br>
+<br>
+ // Make room for the argument(s) on the stack<br>
+ sp -= 4 * args.size();<br>
+<br>
+ // SP Alignment<br>
+ sp &= ~(16ull-1ull); // 16-byte alignment<br>
+<br>
+ // Write arguments onto the stack<br>
+ addr_t arg_pos = sp;<br>
+ for (addr_t arg : args)<br>
+ {<br>
+ reg_value.SetUInt32(arg);<br>
+ error = reg_ctx->WriteRegisterValueToMemory (reg_info_32,<br>
+ arg_pos,<br>
+ reg_info_32->byte_size,<br>
+ reg_value);<br>
+ if (error.Fail())<br>
+ return false;<br>
+ arg_pos += 4;<br>
+ }<br>
+<br>
+ // The return address is pushed onto the stack<br>
+ sp -= 4;<br>
+ reg_value.SetUInt32(return_addr);<br>
+ error = reg_ctx->WriteRegisterValueToMemory (reg_info_32,<br>
+ sp,<br>
+ reg_info_32->byte_size,<br>
+ reg_value);<br>
+ if (error.Fail())<br>
+ return false;<br>
+<br>
+ // Setting %esp to the actual stack value.<br>
+ if (!reg_ctx->WriteRegisterFromUnsigned (sp_reg_num, sp))<br>
+ return false;<br>
+<br>
+ // Setting %eip to the address of the called function.<br>
+ if (!reg_ctx->WriteRegisterFromUnsigned (pc_reg_num, func_addr))<br>
+ return false;<br>
+<br>
+ return true;<br>
+}<br>
+<br>
+<br>
+static bool<br>
+ReadIntegerArgument (Scalar &scalar,<br>
+ unsigned int bit_width,<br>
+ bool is_signed,<br>
+ Process *process,<br>
+ addr_t ¤t_stack_argument)<br>
+{<br>
+ uint32_t byte_size = (bit_width + (8-1))/8;<br>
+ Error error;<br>
+<br>
+ if (!process)<br>
+ return false;<br>
+<br>
+ if (process->ReadScalarIntegerFromMemory(current_stack_argument, byte_size, is_signed, scalar, error))<br>
+ {<br>
+ current_stack_argument += byte_size;<br>
+ return true;<br>
+ }<br>
+ return false;<br>
+}<br>
+<br>
+<br>
+bool<br>
+ABISysV_i386::GetArgumentValues (Thread &thread,<br>
+ ValueList &values) const<br>
+{<br>
+ unsigned int num_values = values.GetSize();<br>
+ unsigned int value_index;<br>
+<br>
+ RegisterContext *reg_ctx = thread.GetRegisterContext().get();<br>
+<br>
+ if (!reg_ctx)<br>
+ return false;<br>
+<br>
+ // Get pointer to the first stack argument<br>
+ addr_t sp = reg_ctx->GetSP(0);<br>
+ if (!sp)<br>
+ return false;<br>
+<br>
+ addr_t current_stack_argument = sp + 4; // jump over return address<br>
+<br>
+ for (value_index = 0;<br>
+ value_index < num_values;<br>
+ ++value_index)<br>
+ {<br>
+ Value *value = values.GetValueAtIndex(value_index);<br>
+<br>
+ if (!value)<br>
+ return false;<br>
+<br>
+ // Currently: Support for extracting values with Clang QualTypes only.<br>
+ ClangASTType clang_type (value->GetClangType());<br>
+ if (clang_type)<br>
+ {<br>
+ bool is_signed;<br>
+ if (clang_type.IsIntegerType (is_signed))<br>
+ {<br>
+ ReadIntegerArgument(value->GetScalar(),<br>
+ clang_type.GetBitSize(&thread),<br>
+ is_signed,<br>
+ thread.GetProcess().get(),<br>
+ current_stack_argument);<br>
+ }<br>
+ else if (clang_type.IsPointerType())<br>
+ {<br>
+ ReadIntegerArgument(value->GetScalar(),<br>
+ clang_type.GetBitSize(&thread),<br>
+ false,<br>
+ thread.GetProcess().get(),<br>
+ current_stack_argument);<br>
+ }<br>
+ }<br>
+ }<br>
+ return true;<br>
+}<br>
+<br>
+<br>
+<br>
+Error<br>
+ABISysV_i386::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObjectSP &new_value_sp)<br>
+{<br>
+ Error error;<br>
+ //ToDo: Yet to be implemented<br>
+ error.SetErrorString("ABISysV_i386::SetReturnValueObject(): Not implemented yet");<br>
+ return error;<br>
+}<br>
+<br>
+<br>
+ValueObjectSP<br>
+ABISysV_i386::GetReturnValueObjectSimple (Thread &thread,<br>
+ ClangASTType &return_clang_type) const<br>
+{<br>
+ ValueObjectSP return_valobj_sp;<br>
+ Value value;<br>
+<br>
+ if (!return_clang_type)<br>
+ return return_valobj_sp;<br>
+<br>
+ value.SetClangType (return_clang_type);<br>
+<br>
+ RegisterContext *reg_ctx = thread.GetRegisterContext().get();<br>
+ if (!reg_ctx)<br>
+ return return_valobj_sp;<br>
+<br>
+ const uint32_t type_flags = return_clang_type.GetTypeInfo ();<br>
+<br>
+ unsigned eax_id = reg_ctx->GetRegisterInfoByName("eax", 0)->kinds[eRegisterKindLLDB];<br>
+ unsigned edx_id = reg_ctx->GetRegisterInfoByName("edx", 0)->kinds[eRegisterKindLLDB];<br>
+<br>
+<br>
+ // Following "IF ELSE" block categorizes various 'Fundamental Data Types'.<br>
+ // The terminology 'Fundamental Data Types' used here is adopted from<br>
+ // Table 2.1 of the reference document (specified on top of this file)<br>
+<br>
+ if (type_flags & eTypeIsPointer) // 'Pointer'<br>
+ {<br>
+ uint32_t ptr = thread.GetRegisterContext()->ReadRegisterAsUnsigned(eax_id, 0) & 0xffffffff ;<br>
+ value.SetValueType(Value::eValueTypeScalar);<br>
+ value.GetScalar() = ptr;<br>
+ return_valobj_sp = ValueObjectConstResult::Create (thread.GetStackFrameAtIndex(0).get(),<br>
+ value,<br>
+ ConstString(""));<br>
+ }<br>
+<br>
+ else if ((type_flags & eTypeIsScalar) || (type_flags & eTypeIsEnumeration)) //'Integral' + 'Floating Point'<br>
+ {<br>
+ value.SetValueType(Value::eValueTypeScalar);<br>
+ const size_t byte_size = return_clang_type.GetByteSize(nullptr);<br>
+ bool success = false;<br>
+<br>
+ if (type_flags & eTypeIsInteger) // 'Integral' except enum<br>
+ {<br>
+ const bool is_signed = ((type_flags & eTypeIsSigned) != 0);<br>
+ uint64_t raw_value = thread.GetRegisterContext()->ReadRegisterAsUnsigned(eax_id, 0) & 0xffffffff ;<br>
+ raw_value |= (thread.GetRegisterContext()->ReadRegisterAsUnsigned(edx_id, 0) & 0xffffffff) << 32;<br>
+<br>
+ switch (byte_size)<br>
+ {<br>
+ default:<br>
+ break;<br>
+<br>
+ case 16:<br>
+ // For clang::BuiltinType::UInt128 & Int128<br>
+ // ToDo: Need to decide how to handle it<br>
+ break ;<br>
+<br>
+ case 8:<br>
+ if (is_signed)<br>
+ value.GetScalar() = (int64_t)(raw_value);<br>
+ else<br>
+ value.GetScalar() = (uint64_t)(raw_value);<br>
+ success = true;<br>
+ break;<br>
+<br>
+ case 4:<br>
+ if (is_signed)<br>
+ value.GetScalar() = (int32_t)(raw_value & UINT32_MAX);<br>
+ else<br>
+ value.GetScalar() = (uint32_t)(raw_value & UINT32_MAX);<br>
+ success = true;<br>
+ break;<br>
+<br>
+ case 2:<br>
+ if (is_signed)<br>
+ value.GetScalar() = (int16_t)(raw_value & UINT16_MAX);<br>
+ else<br>
+ value.GetScalar() = (uint16_t)(raw_value & UINT16_MAX);<br>
+ success = true;<br>
+ break;<br>
+<br>
+ case 1:<br>
+ if (is_signed)<br>
+ value.GetScalar() = (int8_t)(raw_value & UINT8_MAX);<br>
+ else<br>
+ value.GetScalar() = (uint8_t)(raw_value & UINT8_MAX);<br>
+ success = true;<br>
+ break;<br>
+ }<br>
+<br>
+ if (success)<br>
+ return_valobj_sp = ValueObjectConstResult::Create (thread.GetStackFrameAtIndex(0).get(),<br>
+ value,<br>
+ ConstString(""));<br>
+ }<br>
+<br>
+ else if (type_flags & eTypeIsEnumeration) // handles enum<br>
+ {<br>
+ uint32_t enm = thread.GetRegisterContext()->ReadRegisterAsUnsigned(eax_id, 0) & 0xffffffff ;<br>
+ value.SetValueType(Value::eValueTypeScalar);<br>
+ value.GetScalar() = enm;<br>
+ return_valobj_sp = ValueObjectConstResult::Create (thread.GetStackFrameAtIndex(0).get(),<br>
+ value,<br>
+ ConstString(""));<br>
+ }<br>
+<br>
+ else if (type_flags & eTypeIsFloat) // 'Floating Point'<br>
+ {<br>
+ if (byte_size <= 12) // handles float, double, long double, __float80<br>
+ {<br>
+ const RegisterInfo *st0_info = reg_ctx->GetRegisterInfoByName("st0", 0);<br>
+ RegisterValue st0_value;<br>
+<br>
+ if (reg_ctx->ReadRegister (st0_info, st0_value))<br>
+ {<br>
+ DataExtractor data;<br>
+ if (st0_value.GetData(data))<br>
+ {<br>
+ lldb::offset_t offset = 0;<br>
+ long double value_long_double = data.GetLongDouble(&offset);<br>
+<br>
+ if (byte_size == 4) // float is 4 bytes<br>
+ {<br>
+ float value_float = (float)value_long_double;<br>
+ value.GetScalar() = value_float;<br>
+ success = true;<br>
+ }<br>
+ else if (byte_size == 8) // double is 8 bytes<br>
+ {<br>
+ // On Android Platform: long double is also 8 bytes<br>
+ // It will be handled here only.<br>
+ double value_double = (double)value_long_double;<br>
+ value.GetScalar() = value_double;<br>
+ success = true;<br>
+ }<br>
+ else if (byte_size == 12) // long double and __float80 are 12 bytes on i386<br>
+ {<br>
+ value.GetScalar() = value_long_double;<br>
+ success = true;<br>
+ }<br>
+ }<br>
+ }<br>
+<br>
+ if (success)<br>
+ return_valobj_sp = ValueObjectConstResult::Create (thread.GetStackFrameAtIndex(0).get(),<br>
+ value,<br>
+ ConstString(""));<br>
+ }<br>
+ else if(byte_size == 16) // handles __float128<br>
+ {<br>
+ lldb::addr_t storage_addr = (uint32_t)(thread.GetRegisterContext()->ReadRegisterAsUnsigned(eax_id, 0) & 0xffffffff);<br>
+ return_valobj_sp = ValueObjectMemory::Create (&thread,<br>
+ "",<br>
+ Address (storage_addr, nullptr),<br>
+ return_clang_type);<br>
+ }<br>
+ }<br>
+<br>
+ else // Neither 'Integral' nor 'Floating Point'<br>
+ {<br>
+ // If flow reaches here then check type_flags<br>
+ // This type_flags is unhandled<br>
+ }<br>
+ }<br>
+<br>
+ else if (type_flags & eTypeIsComplex) // 'Complex Floating Point'<br>
+ {<br>
+ // ToDo: Yet to be implemented<br>
+ }<br>
+<br>
+ else if (type_flags & eTypeIsVector) // 'Packed'<br>
+ {<br>
+ const size_t byte_size = return_clang_type.GetByteSize(nullptr);<br>
+ if (byte_size > 0)<br>
+ {<br>
+ const RegisterInfo *vec_reg = reg_ctx->GetRegisterInfoByName("ymm0", 0);<br>
+ if (vec_reg == nullptr)<br>
+ {<br>
+ vec_reg = reg_ctx->GetRegisterInfoByName("xmm0", 0);<br>
+ if (vec_reg == nullptr)<br>
+ vec_reg = reg_ctx->GetRegisterInfoByName("mm0", 0);<br>
+ }<br>
+<br>
+ if (vec_reg)<br>
+ {<br>
+ if (byte_size <= vec_reg->byte_size)<br>
+ {<br>
+ ProcessSP process_sp (thread.GetProcess());<br>
+ if (process_sp)<br>
+ {<br>
+ std::unique_ptr<DataBufferHeap> heap_data_ap (new DataBufferHeap(byte_size, 0));<br>
+ const ByteOrder byte_order = process_sp->GetByteOrder();<br>
+ RegisterValue reg_value;<br>
+ if (reg_ctx->ReadRegister(vec_reg, reg_value))<br>
+ {<br>
+ Error error;<br>
+ if (reg_value.GetAsMemoryData (vec_reg,<br>
+ heap_data_ap->GetBytes(),<br>
+ heap_data_ap->GetByteSize(),<br>
+ byte_order,<br>
+ error))<br>
+ {<br>
+ DataExtractor data (DataBufferSP (heap_data_ap.release()),<br>
+ byte_order,<br>
+ process_sp->GetTarget().GetArchitecture().GetAddressByteSize());<br>
+ return_valobj_sp = ValueObjectConstResult::Create (&thread,<br>
+ return_clang_type,<br>
+ ConstString(""),<br>
+ data);<br>
+ }<br>
+ }<br>
+ }<br>
+ }<br>
+ }<br>
+ }<br>
+ }<br>
+<br>
+ else // 'Decimal Floating Point'<br>
+ {<br>
+ //ToDo: Yet to be implemented<br>
+ }<br>
+ return return_valobj_sp;<br>
+}<br>
+<br>
+<br>
+ValueObjectSP<br>
+ABISysV_i386::GetReturnValueObjectImpl (Thread &thread, ClangASTType &return_clang_type) const<br>
+{<br>
+ ValueObjectSP return_valobj_sp;<br>
+<br>
+ if (!return_clang_type)<br>
+ return return_valobj_sp;<br>
+<br>
+ ExecutionContext exe_ctx (thread.shared_from_this());<br>
+ return_valobj_sp = GetReturnValueObjectSimple(thread, return_clang_type);<br>
+ if (return_valobj_sp)<br>
+ return return_valobj_sp;<br>
+<br>
+ RegisterContextSP reg_ctx_sp = thread.GetRegisterContext();<br>
+ if (!reg_ctx_sp)<br>
+ return return_valobj_sp;<br>
+<br>
+ if (return_clang_type.IsAggregateType())<br>
+ {<br>
+ unsigned eax_id = reg_ctx_sp->GetRegisterInfoByName("eax", 0)->kinds[eRegisterKindLLDB];<br>
+ lldb::addr_t storage_addr = (uint32_t)(thread.GetRegisterContext()->ReadRegisterAsUnsigned(eax_id, 0) & 0xffffffff);<br>
+ return_valobj_sp = ValueObjectMemory::Create (&thread,<br>
+ "",<br>
+ Address (storage_addr, nullptr),<br>
+ return_clang_type);<br>
+ }<br>
+<br>
+ return return_valobj_sp;<br>
+}<br>
+<br>
+// This defines CFA as esp+4<br>
+// The saved pc is at CFA-4 (i.e. esp+0)<br>
+// The saved esp is CFA+0<br>
+<br>
+bool<br>
+ABISysV_i386::CreateFunctionEntryUnwindPlan (UnwindPlan &unwind_plan)<br>
+{<br>
+ unwind_plan.Clear();<br>
+ unwind_plan.SetRegisterKind (eRegisterKindDWARF);<br>
+<br>
+ uint32_t sp_reg_num = gcc_dwarf_esp;<br>
+ uint32_t pc_reg_num = gcc_dwarf_eip;<br>
+<br>
+ UnwindPlan::RowSP row(new UnwindPlan::Row);<br>
+ row->GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 4);<br>
+ row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -4, false);<br>
+ row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);<br>
+ unwind_plan.AppendRow (row);<br>
+ unwind_plan.SetSourceName ("i386 at-func-entry default");<br>
+ unwind_plan.SetSourcedFromCompiler (eLazyBoolNo);<br>
+ return true;<br>
+}<br>
+<br>
+// This defines CFA as ebp+8<br>
+// The saved pc is at CFA-4 (i.e. ebp+4)<br>
+// The saved ebp is at CFA-8 (i.e. ebp+0)<br>
+// The saved esp is CFA+0<br>
+<br>
+bool<br>
+ABISysV_i386::CreateDefaultUnwindPlan (UnwindPlan &unwind_plan)<br>
+{<br>
+ unwind_plan.Clear();<br>
+ unwind_plan.SetRegisterKind (eRegisterKindDWARF);<br>
+<br>
+ uint32_t fp_reg_num = gcc_dwarf_ebp;<br>
+ uint32_t sp_reg_num = gcc_dwarf_esp;<br>
+ uint32_t pc_reg_num = gcc_dwarf_eip;<br>
+<br>
+ UnwindPlan::RowSP row(new UnwindPlan::Row);<br>
+ const int32_t ptr_size = 4;<br>
+<br>
+ row->GetCFAValue().SetIsRegisterPlusOffset(fp_reg_num, 2 * ptr_size);<br>
+ row->SetOffset (0);<br>
+<br>
+ row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);<br>
+ row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);<br>
+ row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);<br>
+<br>
+ unwind_plan.AppendRow (row);<br>
+ unwind_plan.SetSourceName ("i386 default unwind plan");<br>
+ unwind_plan.SetSourcedFromCompiler (eLazyBoolNo);<br>
+ unwind_plan.SetUnwindPlanValidAtAllInstructions (eLazyBoolNo);<br>
+ return true;<br>
+}<br>
+<br>
+<br>
+// According to "Register Usage" in reference document (specified on top<br>
+// of this source file) ebx, ebp, esi, edi and esp registers are preserved<br>
+// i.e. non-volatile i.e. callee-saved on i386<br>
+bool<br>
+ABISysV_i386::RegisterIsCalleeSaved (const RegisterInfo *reg_info)<br>
+{<br>
+ if (!reg_info)<br>
+ return false;<br>
+<br>
+ // Saved registers are ebx, ebp, esi, edi, esp, eip<br>
+ const char *name = reg_info->name;<br>
+ if (name[0] == 'e')<br>
+ {<br>
+ switch (name[1])<br>
+ {<br>
+ case 'b':<br>
+ if (name[2] == 'x' || name[2] == 'p')<br>
+ return name[3] == '\0';<br>
+ break;<br>
+ case 'd':<br>
+ if (name[2] == 'i')<br>
+ return name[3] == '\0';<br>
+ break;<br>
+ case 'i':<br>
+ if (name[2] == 'p')<br>
+ return name[3] == '\0';<br>
+ break;<br>
+ case 's':<br>
+ if (name[2] == 'i' || name[2] == 'p')<br>
+ return name[3] == '\0';<br>
+ break;<br>
+ }<br>
+ }<br>
+<br>
+ if (name[0] == 's' && name[1] == 'p' && name[2] == '\0') // sp<br>
+ return true;<br>
+ if (name[0] == 'f' && name[1] == 'p' && name[2] == '\0') // fp<br>
+ return true;<br>
+ if (name[0] == 'p' && name[1] == 'c' && name[2] == '\0') // pc<br>
+ return true;<br>
+<br>
+ return false;<br>
+}<br>
+<br>
+<br>
+void<br>
+ABISysV_i386::Initialize()<br>
+{<br>
+ PluginManager::RegisterPlugin (GetPluginNameStatic(),<br>
+ "System V ABI for i386 targets",<br>
+ CreateInstance);<br>
+}<br>
+<br>
+<br>
+void<br>
+ABISysV_i386::Terminate()<br>
+{<br>
+ PluginManager::UnregisterPlugin (CreateInstance);<br>
+}<br>
+<br>
+<br>
+//------------------------------------------------------------------<br>
+// PluginInterface protocol<br>
+//------------------------------------------------------------------<br>
+lldb_private::ConstString<br>
+ABISysV_i386::GetPluginNameStatic()<br>
+{<br>
+ static ConstString g_name("sysv-i386");<br>
+ return g_name;<br>
+}<br>
+<br>
+<br>
+lldb_private::ConstString<br>
+ABISysV_i386::GetPluginName()<br>
+{<br>
+ return GetPluginNameStatic();<br>
+}<br>
<br>
Added: lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_ABI_SysV-2Di386_ABISysV-5Fi386.h-3Frev-3D240663-26view-3Dauto&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=A4e5-rVmYN79tDvN3fXaw8x8urg5KaBTOdSq0c4vSMM&s=4wCzacnKsA_9GNfz_na1hYmBLYSIPEAwifa7IV_KA3c&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.h?rev=240663&view=auto</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.h (added)<br>
+++ lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.h Thu Jun 25 12:50:15 2015<br>
@@ -0,0 +1,138 @@<br>
+//===------------------- ABISysV_i386.h -------------------------*- C++ -*-===//<br>
+//<br>
+// The LLVM Compiler Infrastructure<br>
+//<br>
+// This file is distributed under the University of Illinois Open Source<br>
+// License. See LICENSE.TXT for details.<br>
+//<br>
+//===----------------------------------------------------------------------===//<br>
+<br>
+#ifndef liblldb_ABISysV_i386_h_<br>
+#define liblldb_ABISysV_i386_h_<br>
+<br>
+// C Includes<br>
+// C++ Includes<br>
+// Other libraries and framework includes<br>
+// Project includes<br>
+#include "lldb/lldb-private.h"<br>
+#include "lldb/Target/ABI.h"<br>
+<br>
+class ABISysV_i386 :<br>
+ public lldb_private::ABI<br>
+{<br>
+public:<br>
+<br>
+ ~ABISysV_i386()<br>
+ {<br>
+ }<br>
+<br>
+ size_t<br>
+ GetRedZoneSize () const override<br>
+ {<br>
+ return 0; // There is no red zone for i386 Architecture<br>
+ }<br>
+<br>
+ bool<br>
+ PrepareTrivialCall (lldb_private::Thread &thread,<br>
+ lldb::addr_t sp,<br>
+ lldb::addr_t functionAddress,<br>
+ lldb::addr_t returnAddress,<br>
+ llvm::ArrayRef<lldb::addr_t> args) const override;<br>
+<br>
+ bool<br>
+ GetArgumentValues (lldb_private::Thread &thread,<br>
+ lldb_private::ValueList &values) const override;<br>
+<br>
+ lldb_private::Error<br>
+ SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObjectSP &new_value) override;<br>
+<br>
+protected:<br>
+ lldb::ValueObjectSP<br>
+ GetReturnValueObjectSimple (lldb_private::Thread &thread,<br>
+ lldb_private::ClangASTType &ast_type) const;<br>
+<br>
+ bool<br>
+ RegisterIsCalleeSaved (const lldb_private::RegisterInfo *reg_info);<br>
+<br>
+public:<br>
+ lldb::ValueObjectSP<br>
+ GetReturnValueObjectImpl (lldb_private::Thread &thread,<br>
+ lldb_private::ClangASTType &type) const override;<br>
+<br>
+ bool<br>
+ CreateFunctionEntryUnwindPlan (lldb_private::UnwindPlan &unwind_plan) override;<br>
+<br>
+ bool<br>
+ CreateDefaultUnwindPlan (lldb_private::UnwindPlan &unwind_plan) override;<br>
+<br>
+ bool<br>
+ RegisterIsVolatile (const lldb_private::RegisterInfo *reg_info) override<br>
+ {<br>
+ return !RegisterIsCalleeSaved (reg_info);<br>
+ }<br>
+<br>
+ // The SysV i386 ABI requires that stack frames be 16 byte aligned.<br>
+ // When there is a trap handler on the stack, e.g. _sigtramp in userland<br>
+ // code, we've seen that the stack pointer is often not aligned properly<br>
+ // before the handler is invoked. This means that lldb will stop the unwind<br>
+ // early -- before the function which caused the trap.<br>
+ //<br>
+ // To work around this, we relax that alignment to be just word-size (4-bytes).<br>
+ // Whitelisting the trap handlers for user space would be easy (_sigtramp) but<br>
+ // in other environments there can be a large number of different functions<br>
+ // involved in async traps.<br>
+<br>
+ // ToDo: When __m256 arguments are passed then stack frames should be<br>
+ // 32 byte aligned. Decide what to do for 32 byte alignment checking<br>
+ bool<br>
+ CallFrameAddressIsValid (lldb::addr_t cfa) override<br>
+ {<br>
+ // Make sure the stack call frame addresses are 4 byte aligned<br>
+ if (cfa & (4ull - 1ull))<br>
+ return false; // Not 4 byte aligned<br>
+ if (cfa == 0)<br>
+ return false; // Zero is not a valid stack address<br>
+ return true;<br>
+ }<br>
+<br>
+ bool<br>
+ CodeAddressIsValid (lldb::addr_t pc) override<br>
+ {<br>
+ // Check whether the address is a valid 32 bit address<br>
+ return (pc <= UINT32_MAX);<br>
+ }<br>
+<br>
+ const lldb_private::RegisterInfo *<br>
+ GetRegisterInfoArray (uint32_t &count) override;<br>
+ //------------------------------------------------------------------<br>
+ // Static Functions<br>
+ //------------------------------------------------------------------<br>
+ static void<br>
+ Initialize();<br>
+<br>
+ static void<br>
+ Terminate();<br>
+<br>
+ static lldb::ABISP<br>
+ CreateInstance (const lldb_private::ArchSpec &arch);<br>
+<br>
+ //------------------------------------------------------------------<br>
+ // PluginInterface protocol<br>
+ //------------------------------------------------------------------<br>
+ static lldb_private::ConstString<br>
+ GetPluginNameStatic();<br>
+<br>
+ virtual lldb_private::ConstString<br>
+ GetPluginName();<br>
+<br>
+ virtual uint32_t<br>
+ GetPluginVersion()<br>
+ {<br>
+ return 1;<br>
+ }<br>
+<br>
+private:<br>
+ ABISysV_i386() : lldb_private::ABI() { } // Call CreateInstance instead.<br>
+};<br>
+<br>
+#endif // liblldb_ABI_h<br>
<br>
Added: lldb/trunk/source/Plugins/ABI/SysV-i386/CMakeLists.txt<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_ABI_SysV-2Di386_CMakeLists.txt-3Frev-3D240663-26view-3Dauto&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=A4e5-rVmYN79tDvN3fXaw8x8urg5KaBTOdSq0c4vSMM&s=1mZfuHtgDUL8Qa2uErbvt_52YL_5tiKkHCzr4U_8dgU&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-i386/CMakeLists.txt?rev=240663&view=auto</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/ABI/SysV-i386/CMakeLists.txt (added)<br>
+++ lldb/trunk/source/Plugins/ABI/SysV-i386/CMakeLists.txt Thu Jun 25 12:50:15 2015<br>
@@ -0,0 +1,5 @@<br>
+set(LLVM_NO_RTTI 1)<br>
+<br>
+add_lldb_library(lldbPluginABISysV_i386<br>
+ ABISysV_i386.cpp<br>
+ )<br>
<br>
Added: lldb/trunk/source/Plugins/ABI/SysV-i386/Makefile<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_ABI_SysV-2Di386_Makefile-3Frev-3D240663-26view-3Dauto&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=A4e5-rVmYN79tDvN3fXaw8x8urg5KaBTOdSq0c4vSMM&s=gf0P_GIVY6GL2onKT0d09ZsR6ovJlN_3d_bzL7WdXbA&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-i386/Makefile?rev=240663&view=auto</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/ABI/SysV-i386/Makefile (added)<br>
+++ lldb/trunk/source/Plugins/ABI/SysV-i386/Makefile Thu Jun 25 12:50:15 2015<br>
@@ -0,0 +1,14 @@<br>
+##===- source/Plugins/ABI/SysV-i386/Makefile -------------*- Makefile -*-===##<br>
+#<br>
+# The LLVM Compiler Infrastructure<br>
+#<br>
+# This file is distributed under the University of Illinois Open Source<br>
+# License. See LICENSE.TXT for details.<br>
+#<br>
+##===----------------------------------------------------------------------===##<br>
+<br>
+LLDB_LEVEL := ../../../..<br>
+LIBRARYNAME := lldbPluginABISysV_i386<br>
+BUILD_ARCHIVE = 1<br>
+<br>
+include $(LLDB_LEVEL)/Makefile<br>
<br>
Modified: lldb/trunk/source/Plugins/Makefile<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lldb_trunk_source_Plugins_Makefile-3Frev-3D240663-26r1-3D240662-26r2-3D240663-26view-3Ddiff&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=A4e5-rVmYN79tDvN3fXaw8x8urg5KaBTOdSq0c4vSMM&s=mTutM6UW5niI1PYqZo4zDMGuVL3zg2-Q3ytwt4RwSlc&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Makefile?rev=240663&r1=240662&r2=240663&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/Makefile (original)<br>
+++ lldb/trunk/source/Plugins/Makefile Thu Jun 25 12:50:15 2015<br>
@@ -12,7 +12,7 @@ LLDB_LEVEL := ../..<br>
include $(LLDB_LEVEL)/../../Makefile.config<br>
<br>
<br>
-PARALLEL_DIRS := ABI/MacOSX-arm ABI/MacOSX-arm64 ABI/MacOSX-i386 ABI/SysV-x86_64 \<br>
+PARALLEL_DIRS := ABI/MacOSX-arm ABI/MacOSX-arm64 ABI/MacOSX-i386 ABI/SysV-i386 ABI/SysV-x86_64 \<br>
ABI/SysV-arm ABI/SysV-arm64 ABI/SysV-hexagon ABI/SysV-ppc ABI/SysV-ppc64 \<br>
Disassembler/llvm \<br>
ObjectContainer/BSD-Archive ObjectFile/ELF ObjectFile/PECOFF \<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br>
</blockquote></div><br></div>