* python/py-frame.c (frapy_block): Fix error message text.
[deliverable/binutils-gdb.git] / gdb / linux-tdep.c
index fbdca463510dc4d47d0657755da7b5117058c88c..90b763f375e921ea327a0b441bd052a1e19ca362 100644 (file)
@@ -241,19 +241,22 @@ linux_get_siginfo_type (struct gdbarch *gdbarch)
   return siginfo_type;
 }
 
-static int
-linux_has_shared_address_space (struct gdbarch *gdbarch)
+/* Return true if the target is running on uClinux instead of normal
+   Linux kernel.  */
+
+int
+linux_is_uclinux (void)
 {
-  /* Determine whether we are running on uClinux or normal Linux
-     kernel.  */
   CORE_ADDR dummy;
-  int target_is_uclinux;
 
-  target_is_uclinux
-    = (target_auxv_search (&current_target, AT_NULL, &dummy) > 0
-       && target_auxv_search (&current_target, AT_PAGESZ, &dummy) == 0);
+  return (target_auxv_search (&current_target, AT_NULL, &dummy) > 0
+         && target_auxv_search (&current_target, AT_PAGESZ, &dummy) == 0);
+}
 
-  return target_is_uclinux;
+static int
+linux_has_shared_address_space (struct gdbarch *gdbarch)
+{
+  return linux_is_uclinux ();
 }
 
 /* This is how we want PTIDs from core files to be printed.  */
@@ -1173,7 +1176,6 @@ struct linux_corefile_thread_data
   bfd *obfd;
   char *note_data;
   int *note_size;
-  int num_notes;
   enum gdb_signal stop_signal;
   linux_collect_thread_registers_ftype collect;
 };
@@ -1191,7 +1193,7 @@ linux_corefile_thread_callback (struct thread_info *info, void *data)
       struct cleanup *old_chain;
       struct regcache *regcache;
       gdb_byte *siginfo_data;
-      LONGEST siginfo_size;
+      LONGEST siginfo_size = 0;
 
       regcache = get_thread_arch_regcache (info->ptid, args->gdbarch);
 
@@ -1206,17 +1208,16 @@ linux_corefile_thread_callback (struct thread_info *info, void *data)
       args->note_data = args->collect (regcache, info->ptid, args->obfd,
                                       args->note_data, args->note_size,
                                       args->stop_signal);
-      args->num_notes++;
 
-      if (siginfo_data != NULL)
-       {
+      /* Don't return anything if we got no register information above,
+         such a core file is useless.  */
+      if (args->note_data != NULL)
+       if (siginfo_data != NULL)
          args->note_data = elfcore_write_note (args->obfd,
                                                args->note_data,
                                                args->note_size,
                                                "CORE", NT_SIGINFO,
                                                siginfo_data, siginfo_size);
-         args->num_notes++;
-       }
 
       do_cleanups (old_chain);
     }
@@ -1464,7 +1465,6 @@ linux_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size,
   thread_args.obfd = obfd;
   thread_args.note_data = note_data;
   thread_args.note_size = note_size;
-  thread_args.num_notes = 0;
   thread_args.stop_signal = find_stop_signal ();
   thread_args.collect = collect;
   iterate_over_threads (linux_corefile_thread_callback, &thread_args);
This page took 0.02381 seconds and 4 git commands to generate.