* linespec.c (decode_objc): Add cleanup to free
[deliverable/binutils-gdb.git] / gdb / nto-tdep.c
index d9c95a700dc3df9f56d2eb14f5ef1b63211e1d95..5e0c9105cf83d643bb0649df5da29f58a89b8849 100644 (file)
@@ -1,7 +1,6 @@
 /* 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.
 
@@ -59,9 +58,9 @@ nto_target (void)
 #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;
@@ -89,10 +88,12 @@ nto_map_arch_to_cputype (const char *arch)
 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)
@@ -126,13 +127,7 @@ nto_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathname)
   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)
     {
@@ -237,7 +232,7 @@ nto_parse_redirection (char *pargv[], const char **pin, const char **pout,
   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.  */
 
@@ -263,7 +258,7 @@ struct lm_info
 
 
 static CORE_ADDR
-LM_ADDR (struct so_list *so)
+lm_addr (struct so_list *so)
 {
   if (so->lm_info->l_addr == (CORE_ADDR)-1)
     {
@@ -314,8 +309,8 @@ nto_relocate_section_addresses (struct so_list *so, struct target_section *sec)
   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
@@ -381,9 +376,9 @@ nto_initialize_signals (void)
 {
   /* 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)
@@ -413,6 +408,7 @@ When non-zero, nto specific debug info is\n\
 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);
 }
This page took 0.051222 seconds and 4 git commands to generate.