/* ARM Symbian OS target support.
- Copyright (C) 2008, 2009, 2010
- Free Software Foundation, Inc.
+ Copyright (C) 2008-2020 Free Software Foundation, Inc.
This file is part of GDB.
/* If PC is in a DLL import stub, return the address of the `real'
function belonging to the stub. */
-CORE_ADDR
+static CORE_ADDR
arm_symbian_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
{
struct gdbarch *gdbarch;
CORE_ADDR dest;
gdb_byte buf[4];
- if (!in_plt_section (pc, NULL))
+ if (!in_plt_section (pc))
return 0;
if (target_read_memory (pc, buf, 4) != 0)
arm_symbian_init_abi (struct gdbarch_info info,
struct gdbarch *gdbarch)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
/* Shared library handling. */
set_gdbarch_skip_trampoline_code (gdbarch, arm_symbian_skip_trampoline_code);
+ /* On this target, the toolchain outputs ELF files, with `sym' for
+ filename extension (e.g., `FOO.sym'); these are post-linker
+ processed into PE-ish DLLs (e.g., `FOO.dll'), and it's these that
+ are actually copied to and run on the target. Naturally, when
+ listing shared libraries, Symbian stubs report the DLL filenames.
+ Setting this makes it so that GDB automatically looks for the
+ corresponding ELF files on the host's filesystem. */
+ set_gdbarch_solib_symbols_extension (gdbarch, "sym");
+
+ /* Canonical paths on this target look like `c:\sys\bin\bar.dll',
+ for example. */
+ set_gdbarch_has_dos_based_file_system (gdbarch, 1);
+
set_solib_ops (gdbarch, &solib_target_so_ops);
}
static enum gdb_osabi
arm_symbian_osabi_sniffer (bfd *abfd)
{
- Elf_Internal_Phdr *phdrs, **segments;
+ Elf_Internal_Phdr *phdrs;
long phdrs_size;
int num_phdrs, i;
if (phdrs_size == -1)
return GDB_OSABI_UNKNOWN;
- phdrs = alloca (phdrs_size);
+ phdrs = (Elf_Internal_Phdr *) alloca (phdrs_size);
num_phdrs = bfd_get_elf_phdrs (abfd, phdrs);
if (num_phdrs == -1)
return GDB_OSABI_UNKNOWN;