/* nto-tdep.c - general QNX Neutrino target functionality.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
Contributed by QNX Software Systems Ltd.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "gdb_stat.h"
#include "gdb_string.h"
#include "elf-bfd.h"
#include "solib-svr4.h"
#include "gdbcore.h"
+#include "objfiles.h"
+
+#include <string.h>
#ifdef __CYGWIN__
#include <sys/cygwin.h>
#define PATH_FMT "%s/lib:%s/usr/lib:%s/usr/photon/lib:%s/usr/photon/dll:%s/lib/dll"
nto_root = nto_target ();
- if (strcmp (TARGET_ARCHITECTURE->arch_name, "i386") == 0)
+ if (strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name, "i386") == 0)
{
arch = "x86";
endian = "";
}
- else if (strcmp (TARGET_ARCHITECTURE->arch_name, "rs6000") == 0
- || strcmp (TARGET_ARCHITECTURE->arch_name, "powerpc") == 0)
+ else if (strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name,
+ "rs6000") == 0
+ || strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name,
+ "powerpc") == 0)
{
arch = "ppc";
endian = "be";
}
else
{
- arch = TARGET_ARCHITECTURE->arch_name;
- endian = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? "be" : "le";
+ arch = gdbarch_bfd_arch_info (current_gdbarch)->arch_name;
+ endian = gdbarch_byte_order (current_gdbarch)
+ == BFD_ENDIAN_BIG ? "be" : "le";
}
/* In case nto_root is short, add strlen(solib)
const char *arch;
nto_root = nto_target ();
- if (strcmp (TARGET_ARCHITECTURE->arch_name, "i386") == 0)
+ if (strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name, "i386") == 0)
{
arch = "x86";
endian = "";
}
- else if (strcmp (TARGET_ARCHITECTURE->arch_name, "rs6000") == 0
- || strcmp (TARGET_ARCHITECTURE->arch_name, "powerpc") == 0)
+ else if (strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name,
+ "rs6000") == 0
+ || strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name,
+ "powerpc") == 0)
{
arch = "ppc";
endian = "be";
}
else
{
- arch = TARGET_ARCHITECTURE->arch_name;
- endian = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? "be" : "le";
+ arch = gdbarch_bfd_arch_info (current_gdbarch)->arch_name;
+ endian = gdbarch_byte_order (current_gdbarch)
+ == BFD_ENDIAN_BIG ? "be" : "le";
}
sprintf (arch_path, "%s/%s%s", nto_root, arch, endian);
{
struct link_map_offsets *lmo = nto_fetch_link_map_offsets ();
- return (CORE_ADDR) extract_signed_integer (so->lm_info->lm +
- lmo->l_addr_offset,
- lmo->l_addr_size);
+ return extract_typed_address (so->lm_info->lm + lmo->l_addr_offset,
+ builtin_type_void_data_ptr);
}
static CORE_ADDR
nto_truncate_ptr (CORE_ADDR addr)
{
- if (TARGET_PTR_BIT == sizeof (CORE_ADDR) * 8)
+ if (gdbarch_ptr_bit (current_gdbarch) == sizeof (CORE_ADDR) * 8)
/* We don't need to truncate anything, and the bit twiddling below
will fail due to overflow problems. */
return addr;
else
- return addr & (((CORE_ADDR) 1 << TARGET_PTR_BIT) - 1);
+ return addr & (((CORE_ADDR) 1 << gdbarch_ptr_bit (current_gdbarch)) - 1);
}
Elf_Internal_Phdr *
}
void
-nto_dummy_supply_regset (char *regs)
+nto_dummy_supply_regset (struct regcache *regcache, char *regs)
{
/* Do nothing. */
}