Skip to contentSkip to conversation

tcg/i386: Use GDB JIT debugging interface only for hosts with ELF

PATCH New Stefan Weil 1 participant 1 message Apr 6, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcg/i386: Use GDB JIT debugging interface only for hosts with ELF

Not all i386 / x86_64 hosts use ELF. Ask the compiler whether ELF is used.

On w64, gdb crashes when ELF_HOST_MACHINE is defined.

Cc Richard Henderson <[email protected]>
Cc Blue Swirl <[email protected]>
---
 tcg/i386/tcg-target.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
tcg/i386/tcg-target.c +3 -1
index 871a7e7..e34ea4b 100644
@@ -2102,7 +2102,9 @@ typedef struct {
     DebugFrameFDE fde;
 } DebugFrame;
 
-#if TCG_TARGET_REG_BITS == 64
+#if !defined(__ELF__)
+    /* Host machine without ELF. */
+#elif TCG_TARGET_REG_BITS == 64
 #define ELF_HOST_MACHINE EM_X86_64
 static DebugFrame debug_frame = {
     .cie.len = sizeof(DebugFrameCIE)-4, /* length after .len member */
Signature · 1 line
1.7.9