2007-06-06 Markus Deuling <deuling@de.ibm.com>
[deliverable/binutils-gdb.git] / gdb / utils.c
index 4d90812ac7ceea2b711efb9176d72584be3d6b86..e1fb9ed48c416d9f4f6a5a70b72252cba6f7416d 100644 (file)
@@ -906,18 +906,6 @@ quit (void)
 #endif
 }
 
-/* Control C comes here */
-void
-request_quit (int signo)
-{
-  quit_flag = 1;
-  /* Restore the signal handler.  Harmless with BSD-style signals,
-     needed for System V-style signals.  */
-  signal (signo, request_quit);
-
-  if (immediate_quit)
-    quit ();
-}
 \f
 /* Called when a memory allocation fails, with the number of bytes of
    memory requested in SIZE. */
@@ -2452,15 +2440,12 @@ subset_compare (char *string_to_compare, char *template_string)
   return match;
 }
 
-
-static void pagination_on_command (char *arg, int from_tty);
 static void
 pagination_on_command (char *arg, int from_tty)
 {
   pagination_enabled = 1;
 }
 
-static void pagination_on_command (char *arg, int from_tty);
 static void
 pagination_off_command (char *arg, int from_tty)
 {
@@ -2574,7 +2559,7 @@ paddress (CORE_ADDR addr)
      when it won't occur. */
   /* NOTE: This assumes that the significant address information is
      kept in the least significant bits of ADDR - the upper bits were
-     either zero or sign extended.  Should ADDRESS_TO_POINTER() or
+     either zero or sign extended.  Should gdbarch_address_to_pointer or
      some ADDRESS_TO_PRINTABLE() be used to do the conversion?  */
 
   int addr_bit = TARGET_ADDR_BIT;
@@ -2857,7 +2842,7 @@ string_to_core_addr (const char *my_string)
   CORE_ADDR addr = 0;
   if (my_string[0] == '0' && tolower (my_string[1]) == 'x')
     {
-      /* Assume that it is in decimal.  */
+      /* Assume that it is in hex.  */
       int i;
       for (i = 2; my_string[i] != '\0'; i++)
        {
@@ -3210,3 +3195,31 @@ strtoulst (const char *num, const char **trailer, int base)
   else
     return result;
 }
+
+/* Simple, portable version of dirname that does not modify its
+   argument.  */
+
+char *
+ldirname (const char *filename)
+{
+  const char *base = lbasename (filename);
+  char *dirname;
+
+  while (base > filename && IS_DIR_SEPARATOR (base[-1]))
+    --base;
+
+  if (base == filename)
+    return NULL;
+
+  dirname = xmalloc (base - filename + 2);
+  memcpy (dirname, filename, base - filename);
+
+  /* On DOS based file systems, convert "d:foo" to "d:.", so that we
+     create "d:./bar" later instead of the (different) "d:/bar".  */
+  if (base - filename == 2 && IS_ABSOLUTE_PATH (base)
+      && !IS_DIR_SEPARATOR (filename[0]))
+    dirname[base++ - filename] = '.';
+
+  dirname[base - filename] = '\0';
+  return dirname;
+}
This page took 0.027589 seconds and 4 git commands to generate.