SourceLevelDebugPkg Owner,

Please review this patch.

SourceLevelDebugPkg: DebugAgentLib: Fix clang/Xcode 5 compile/link errors

Move ExceptionStubHeaderSize from 16 to 32 bits to work around clang relocation 
limitation
Use movw, not move for 32-bit segment register operations. 

diff --git 
a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.h 
b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.h
index 6f1d3e5..53d9660 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.h
+++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.h
@@ -67,7 +67,7 @@
 
 extern UINTN  Exception0Handle;
 extern UINTN  TimerInterruptHandle;
-extern UINT16 ExceptionStubHeaderSize;
+extern UINT32 ExceptionStubHeaderSize;
 extern BOOLEAN mSkipBreakpoint;
 extern EFI_VECTOR_HANDOFF_INFO mVectorHandoffInfoDebugAgent[];
 extern UINTN                   mVectorHandoffInfoCount;
diff --git 
a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.S 
b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.S
index 2849391..efeaebc 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.S
+++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.S
@@ -33,7 +33,7 @@ ASM_GLOBAL ASM_PFX(CommonEntry)
 
 .data
 
-ASM_PFX(ExceptionStubHeaderSize):  .word     ASM_PFX(Exception1Handle) - 
ASM_PFX(Exception0Handle)
+ASM_PFX(ExceptionStubHeaderSize):  .long     ASM_PFX(Exception1Handle) - 
ASM_PFX(Exception0Handle)
 
 .text
 
diff --git 
a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.asm 
b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.asm
index 9b219fc..2aaf5b7 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.asm
+++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.asm
@@ -38,7 +38,7 @@ ENDM
 
 .data
 
-ExceptionStubHeaderSize   DW    Exception1Handle - Exception0Handle
+ExceptionStubHeaderSize   DD    Exception1Handle - Exception0Handle
 CommonEntryAddr           DD    CommonEntry
 
 .code
diff --git 
a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.S 
b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.S
index 365bc94..276f036 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.S
+++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.S
@@ -34,7 +34,7 @@ ASM_GLOBAL ASM_PFX(CommonEntry)
 
 .data
 
-ASM_PFX(ExceptionStubHeaderSize):  .word     ASM_PFX(Exception1Handle) - 
ASM_PFX(Exception0Handle)
+ASM_PFX(ExceptionStubHeaderSize):  .long     ASM_PFX(Exception1Handle) - 
ASM_PFX(Exception0Handle)
 
 
 .text
@@ -271,13 +271,13 @@ NoExtrPush:
   movzwq   32(%rbp), %rax
 #  movq     %cs, %rax
   pushq    %rax
-  movq     %ds, %rax
+  movw     %ds, %rax
   pushq    %rax
-  movq     %es, %rax
+  movw     %es, %rax
   pushq    %rax
-  movq     %fs, %rax
+  movw     %fs, %rax
   pushq    %rax
-  movq     %gs, %rax
+  movw     %gs, %rax
   pushq    %rax
 
 ## UINT64  Rip;
diff --git 
a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.asm 
b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.asm
index cf8c5f0..0f076a7 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.asm
+++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.asm
@@ -32,7 +32,7 @@ AGENT_HANDLER_SIGNATURE  MACRO
   db   41h, 47h, 54h, 48h       ; SIGNATURE_32('A','G','T','H')
 ENDM
 
-ExceptionStubHeaderSize        dw      Exception1Handle - Exception0Handle ;
+ExceptionStubHeaderSize        dd      Exception1Handle - Exception0Handle ;
 CommonEntryAddr                dq      CommonEntry ;
 
 .code


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to