2012-03-01 Pedro Alves <palves@redhat.com>
[deliverable/binutils-gdb.git] / gdb / linux-tdep.c
index 421518a89ad1ff497dfc2ee4caf34c16a7843eb1..d94cf6e4c3b2db8427f95e8cc5958900daa1b7e9 100644 (file)
@@ -173,8 +173,8 @@ linux_get_siginfo_type (struct gdbarch *gdbarch)
   return siginfo_type;
 }
 
-int
-linux_has_shared_address_space (void)
+static int
+linux_has_shared_address_space (struct gdbarch *gdbarch)
 {
   /* Determine whether we are running on uClinux or normal Linux
      kernel.  */
@@ -402,7 +402,6 @@ linux_info_proc (struct gdbarch *gdbarch, char *args,
        {
          struct cleanup *cleanup = make_cleanup (xfree, data);
          const char *p = data;
-         const char *ep;
          ULONGEST val;
 
          printf_filtered (_("Process: %s\n"),
@@ -410,10 +409,15 @@ linux_info_proc (struct gdbarch *gdbarch, char *args,
 
          while (*p && isspace (*p))
            p++;
-         if (*p == '(' && (ep = strchr (p, ')')) != NULL)
+         if (*p == '(')
            {
-             printf_filtered ("Exec file: %.*s\n", (int) (ep - p - 1), p + 1);
-             p = ep + 1;
+             const char *ep = strchr (p, ')');
+             if (ep != NULL)
+               {
+                 printf_filtered ("Exec file: %.*s\n",
+                                  (int) (ep - p - 1), p + 1);
+                 p = ep + 1;
+               }
            }
 
          while (*p && isspace (*p))
@@ -856,8 +860,13 @@ linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_gdbarch_info_proc (gdbarch, linux_info_proc);
   set_gdbarch_find_memory_regions (gdbarch, linux_find_memory_regions);
   set_gdbarch_make_corefile_notes (gdbarch, linux_make_corefile_notes_1);
+  set_gdbarch_has_shared_address_space (gdbarch,
+                                       linux_has_shared_address_space);
 }
 
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+extern initialize_file_ftype _initialize_linux_tdep;
+
 void
 _initialize_linux_tdep (void)
 {
This page took 0.025663 seconds and 4 git commands to generate.