/* nto-tdep.c - general QNX Neutrino target functionality.
- Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+ Copyright (C) 2003-2004, 2007-2012 Free Software Foundation, Inc.
Contributed by QNX Software Systems Ltd.
#ifdef __CYGWIN__
static char buf[PATH_MAX];
if (p)
- cygwin_conv_to_posix_path (p, buf);
+ cygwin_conv_path (CCP_WIN_A_TO_POSIX, p, buf, PATH_MAX);
else
- cygwin_conv_to_posix_path (default_nto_target, buf);
+ cygwin_conv_path (CCP_WIN_A_TO_POSIX, default_nto_target, buf, PATH_MAX);
return buf;
#else
return p ? p : default_nto_target;
int
nto_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathname)
{
- char *buf, *arch_path, *nto_root, *endian, *base;
+ char *buf, *arch_path, *nto_root, *endian;
+ const char *base;
const char *arch;
int ret;
-#define PATH_FMT "%s/lib:%s/usr/lib:%s/usr/photon/lib:%s/usr/photon/dll:%s/lib/dll"
+#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 (gdbarch_bfd_arch_info (target_gdbarch)->arch_name, "i386") == 0)
sprintf (buf, PATH_FMT, arch_path, arch_path, arch_path, arch_path,
arch_path);
- /* Don't assume basename() isn't destructive. */
- base = strrchr (solib, '/');
- if (!base)
- base = solib;
- else
- base++; /* Skip over '/'. */
-
+ base = lbasename (solib);
ret = openp (buf, 1, base, o_flags, temp_pathname);
if (ret < 0 && base != solib)
{
return argv;
}
-/* The struct lm_info, LM_ADDR, and nto_truncate_ptr are copied from
+/* The struct lm_info, lm_addr, and nto_truncate_ptr are copied from
solib-svr4.c to support nto_relocate_section_addresses
which is different from the svr4 version. */
static CORE_ADDR
-LM_ADDR (struct so_list *so)
+lm_addr (struct so_list *so)
{
if (so->lm_info->l_addr == (CORE_ADDR)-1)
{
Elf_Internal_Phdr *phdr = find_load_phdr (sec->bfd);
unsigned vaddr = phdr ? phdr->p_vaddr : 0;
- sec->addr = nto_truncate_ptr (sec->addr + LM_ADDR (so) - vaddr);
- sec->endaddr = nto_truncate_ptr (sec->endaddr + LM_ADDR (so) - vaddr);
+ sec->addr = nto_truncate_ptr (sec->addr + lm_addr (so) - vaddr);
+ sec->endaddr = nto_truncate_ptr (sec->endaddr + lm_addr (so) - vaddr);
}
/* This is cheating a bit because our linker code is in libc.so. If we
{
/* We use SIG45 for pulses, or something, so nostop, noprint
and pass them. */
- signal_stop_update (target_signal_from_name ("SIG45"), 0);
- signal_print_update (target_signal_from_name ("SIG45"), 0);
- signal_pass_update (target_signal_from_name ("SIG45"), 1);
+ signal_stop_update (gdb_signal_from_name ("SIG45"), 0);
+ signal_print_update (gdb_signal_from_name ("SIG45"), 0);
+ signal_pass_update (gdb_signal_from_name ("SIG45"), 1);
/* By default we don't want to stop on these two, but we do want to pass. */
#if defined(SIGSELECT)
displayed. Different information is displayed\n\
for different positive values."),
NULL,
- NULL, /* FIXME: i18n: QNX NTO internal debugging is %s. */
+ NULL, /* FIXME: i18n: QNX NTO internal
+ debugging is %s. */
&setdebuglist, &showdebuglist);
}