| OLD | NEW | 
|---|
| 1 /* ARM Symbian OS target support. | 1 /* ARM Symbian OS target support. | 
| 2 | 2 | 
| 3    Copyright (C) 2008-2012 Free Software Foundation, Inc. | 3    Copyright (C) 2008-2012 Free Software Foundation, Inc. | 
| 4 | 4 | 
| 5    This file is part of GDB. | 5    This file is part of GDB. | 
| 6 | 6 | 
| 7    This program is free software; you can redistribute it and/or modify | 7    This program is free software; you can redistribute it and/or modify | 
| 8    it under the terms of the GNU General Public License as published by | 8    it under the terms of the GNU General Public License as published by | 
| 9    the Free Software Foundation; either version 3 of the License, or | 9    the Free Software Foundation; either version 3 of the License, or | 
| 10    (at your option) any later version. | 10    (at your option) any later version. | 
| (...skipping 11 matching lines...) Expand all  Loading... | 
| 22 #include "objfiles.h" | 22 #include "objfiles.h" | 
| 23 #include "osabi.h" | 23 #include "osabi.h" | 
| 24 #include "solib.h" | 24 #include "solib.h" | 
| 25 #include "solib-target.h" | 25 #include "solib-target.h" | 
| 26 #include "target.h" | 26 #include "target.h" | 
| 27 #include "elf-bfd.h" | 27 #include "elf-bfd.h" | 
| 28 | 28 | 
| 29 /* If PC is in a DLL import stub, return the address of the `real' | 29 /* If PC is in a DLL import stub, return the address of the `real' | 
| 30    function belonging to the stub.  */ | 30    function belonging to the stub.  */ | 
| 31 | 31 | 
| 32 CORE_ADDR | 32 static CORE_ADDR | 
| 33 arm_symbian_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) | 33 arm_symbian_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) | 
| 34 { | 34 { | 
| 35   struct gdbarch *gdbarch; | 35   struct gdbarch *gdbarch; | 
| 36   enum bfd_endian byte_order; | 36   enum bfd_endian byte_order; | 
| 37   ULONGEST insn; | 37   ULONGEST insn; | 
| 38   CORE_ADDR dest; | 38   CORE_ADDR dest; | 
| 39   gdb_byte buf[4]; | 39   gdb_byte buf[4]; | 
| 40 | 40 | 
| 41   if (!in_plt_section (pc, NULL)) | 41   if (!in_plt_section (pc, NULL)) | 
| 42     return 0; | 42     return 0; | 
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 82   set_gdbarch_has_dos_based_file_system (gdbarch, 1); | 82   set_gdbarch_has_dos_based_file_system (gdbarch, 1); | 
| 83 | 83 | 
| 84   set_solib_ops (gdbarch, &solib_target_so_ops); | 84   set_solib_ops (gdbarch, &solib_target_so_ops); | 
| 85 } | 85 } | 
| 86 | 86 | 
| 87 /* Recognize Symbian object files.  */ | 87 /* Recognize Symbian object files.  */ | 
| 88 | 88 | 
| 89 static enum gdb_osabi | 89 static enum gdb_osabi | 
| 90 arm_symbian_osabi_sniffer (bfd *abfd) | 90 arm_symbian_osabi_sniffer (bfd *abfd) | 
| 91 { | 91 { | 
| 92   Elf_Internal_Phdr *phdrs, **segments; | 92   Elf_Internal_Phdr *phdrs; | 
| 93   long phdrs_size; | 93   long phdrs_size; | 
| 94   int num_phdrs, i; | 94   int num_phdrs, i; | 
| 95 | 95 | 
| 96   /* Symbian executables are always shared objects (ET_DYN).  */ | 96   /* Symbian executables are always shared objects (ET_DYN).  */ | 
| 97   if (elf_elfheader (abfd)->e_type == ET_EXEC) | 97   if (elf_elfheader (abfd)->e_type == ET_EXEC) | 
| 98     return GDB_OSABI_UNKNOWN; | 98     return GDB_OSABI_UNKNOWN; | 
| 99 | 99 | 
| 100   if (elf_elfheader (abfd)->e_ident[EI_OSABI] != ELFOSABI_NONE) | 100   if (elf_elfheader (abfd)->e_ident[EI_OSABI] != ELFOSABI_NONE) | 
| 101     return GDB_OSABI_UNKNOWN; | 101     return GDB_OSABI_UNKNOWN; | 
| 102 | 102 | 
| (...skipping 11 matching lines...) Expand all  Loading... | 
| 114     return GDB_OSABI_UNKNOWN; | 114     return GDB_OSABI_UNKNOWN; | 
| 115 | 115 | 
| 116   for (i = 0; i < num_phdrs; i++) | 116   for (i = 0; i < num_phdrs; i++) | 
| 117     if (phdrs[i].p_type == PT_LOAD && phdrs[i].p_offset == 0) | 117     if (phdrs[i].p_type == PT_LOAD && phdrs[i].p_offset == 0) | 
| 118       return GDB_OSABI_UNKNOWN; | 118       return GDB_OSABI_UNKNOWN; | 
| 119 | 119 | 
| 120   /* Looks like a Symbian binary.  */ | 120   /* Looks like a Symbian binary.  */ | 
| 121   return GDB_OSABI_SYMBIAN; | 121   return GDB_OSABI_SYMBIAN; | 
| 122 } | 122 } | 
| 123 | 123 | 
|  | 124 /* -Wmissing-prototypes */ | 
|  | 125 extern initialize_file_ftype _initialize_arm_symbian_tdep; | 
|  | 126 | 
| 124 void | 127 void | 
| 125 _initialize_arm_symbian_tdep (void) | 128 _initialize_arm_symbian_tdep (void) | 
| 126 { | 129 { | 
| 127   gdbarch_register_osabi_sniffer (bfd_arch_arm, | 130   gdbarch_register_osabi_sniffer (bfd_arch_arm, | 
| 128                                   bfd_target_elf_flavour, | 131                                   bfd_target_elf_flavour, | 
| 129                                   arm_symbian_osabi_sniffer); | 132                                   arm_symbian_osabi_sniffer); | 
| 130 | 133 | 
| 131   gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_SYMBIAN, | 134   gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_SYMBIAN, | 
| 132                           arm_symbian_init_abi); | 135                           arm_symbian_init_abi); | 
| 133 } | 136 } | 
| OLD | NEW | 
|---|