Add _bfd_elf_ifunc_get_synthetic_symtab
[platform/upstream/binutils.git] / gdb / amd64-windows-tdep.c
index a75d6ba..f90bd5b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2013 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2014 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -18,8 +18,6 @@
 #include "defs.h"
 #include "osabi.h"
 #include "amd64-tdep.h"
-#include "solib.h"
-#include "solib-target.h"
 #include "gdbtypes.h"
 #include "gdbcore.h"
 #include "regcache.h"
@@ -357,8 +355,8 @@ amd64_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
          call_dest = pc + 5 + extract_signed_integer (buf, 4, byte_order);
          s = lookup_minimal_symbol_by_pc (call_dest);
          if (s.minsym != NULL
-             && SYMBOL_LINKAGE_NAME (s.minsym) != NULL
-             && strcmp (SYMBOL_LINKAGE_NAME (s.minsym), "__main") == 0)
+             && MSYMBOL_LINKAGE_NAME (s.minsym) != NULL
+             && strcmp (MSYMBOL_LINKAGE_NAME (s.minsym), "__main") == 0)
            pc += 5;
        }
     }
@@ -651,7 +649,8 @@ amd64_windows_frame_decode_insns (struct frame_info *this_frame,
           ex_ui.CountOfCodes, ex_ui.FrameRegisterOffset);
 
       /* Check version.  */
-      if (PEX64_UWI_VERSION (ex_ui.Version_Flags) != 1)
+      if (PEX64_UWI_VERSION (ex_ui.Version_Flags) != 1
+         && PEX64_UWI_VERSION (ex_ui.Version_Flags) != 2)
        return;
 
       if (j == 0
@@ -698,7 +697,17 @@ amd64_windows_frame_decode_insns (struct frame_info *this_frame,
        return;
 
       end_insns = &insns[codes_count * 2];
-      for (p = insns; p < end_insns; p += 2)
+      p = insns;
+
+      /* Skip opcodes 6 of version 2.  This opcode is not documented.  */
+      if (PEX64_UWI_VERSION (ex_ui.Version_Flags) == 2)
+       {
+         for (; p < end_insns; p += 2)
+           if (PEX64_UNWCODE_CODE (p[1]) != 6)
+             break;
+       }
+
+      for (; p < end_insns; p += 2)
        {
          int reg;
 
@@ -817,7 +826,7 @@ amd64_windows_frame_decode_insns (struct frame_info *this_frame,
          CORE_ADDR chain_vma;
 
          chain_vma = cache->image_base + unwind_info
-           + sizeof (ex_ui) + ((codes_count + 1) & ~1) * 2 + 8;
+           + sizeof (ex_ui) + ((codes_count + 1) & ~1) * 2;
 
          if (target_read_memory (chain_vma, (gdb_byte *) &d, sizeof (d)) != 0)
            return;
@@ -828,6 +837,15 @@ amd64_windows_frame_decode_insns (struct frame_info *this_frame,
            extract_unsigned_integer (d.rva_EndAddress, 4, byte_order);
          unwind_info =
            extract_unsigned_integer (d.rva_UnwindData, 4, byte_order);
+
+         if (frame_debug)
+           fprintf_unfiltered
+             (gdb_stdlog,
+              "amd64_windows_frame_decodes_insn (next in chain):"
+              " unwind_data=%s, start_rva=%s, end_rva=%s\n",
+              paddress (gdbarch, unwind_info),
+              paddress (gdbarch, cache->start_rva),
+              paddress (gdbarch, cache->end_rva));
        }
 
       /* Allow the user to break this loop.  */
@@ -1135,7 +1153,7 @@ amd64_windows_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
        = (indirect_addr
           ? lookup_minimal_symbol_by_pc (indirect_addr).minsym
           : NULL);
-      const char *symname = indsym ? SYMBOL_LINKAGE_NAME (indsym) : NULL;
+      const char *symname = indsym ? MSYMBOL_LINKAGE_NAME (indsym) : NULL;
 
       if (symname)
        {
@@ -1177,6 +1195,8 @@ amd64_windows_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 
   amd64_init_abi (info, gdbarch);
 
+  windows_init_abi (info, gdbarch);
+
   /* On Windows, "long"s are only 32bit.  */
   set_gdbarch_long_bit (gdbarch, 32);
 
@@ -1187,14 +1207,9 @@ amd64_windows_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_gdbarch_skip_trampoline_code (gdbarch,
                                    amd64_windows_skip_trampoline_code);
 
-  set_gdbarch_iterate_over_objfiles_in_search_order
-    (gdbarch, windows_iterate_over_objfiles_in_search_order);
-
   set_gdbarch_skip_prologue (gdbarch, amd64_windows_skip_prologue);
 
   set_gdbarch_auto_wide_charset (gdbarch, amd64_windows_auto_wide_charset);
-
-  set_solib_ops (gdbarch, &solib_target_so_ops);
 }
 
 /* -Wmissing-prototypes */