2002-08-14 Michael Snyder <msnyder@redhat.com>
[deliverable/binutils-gdb.git] / gdb / linux-proc.c
index 4a5657318350fbab569445bf070771fef1939071..c66df986689da7d60013c489829724a441f2cac2 100644 (file)
@@ -1,4 +1,5 @@
-/* Linux-specific methods for using the /proc file system.
+/* GNU/Linux specific methods for using the /proc file system.
+
    Copyright 2001, 2002 Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -30,6 +31,7 @@
 #include "gdbthread.h" /* for struct thread_info etc. */
 #include "elf-bfd.h"   /* for elfcore_write_* */
 #include "cli/cli-decode.h"    /* for add_info */
+#include "gdb_string.h"
 
 /* Function: child_pid_to_exec_file
  *
@@ -76,7 +78,14 @@ read_mapping (FILE *mapfile,
 
   if (ret > 0 && ret != EOF && *inode != 0)
     {
-      ret += fscanf (mapfile, "%s\n", filename);
+      /* Eat everything up to EOL for the filename.  This will prevent
+       weird filenames (such as one with embedded whitespace) from
+       confusing this code.  It also makes this code more robust
+       in respect to annotations the kernel may add after the
+       filename.
+
+       Note the filename is used for informational purposes only.  */
+      ret += fscanf (mapfile, "%[^\n]\n", filename);
     }
   else
     {
@@ -159,6 +168,9 @@ linux_do_thread_registers (bfd *obfd, ptid_t ptid,
 {
   gdb_gregset_t gregs;
   gdb_fpregset_t fpregs;
+#ifdef FILL_FPXREGSET
+  gdb_fpxregset_t fpxregs;
+#endif
   unsigned long merged_pid = ptid_get_tid (ptid) << 16 | ptid_get_pid (ptid);
 
   fill_gregset (&gregs, -1);
@@ -175,6 +187,14 @@ linux_do_thread_registers (bfd *obfd, ptid_t ptid,
                                              note_size, 
                                              &fpregs, 
                                              sizeof (fpregs));
+#ifdef FILL_FPXREGSET
+  fill_fpxregset (&fpxregs, -1);
+  note_data = (char *) elfcore_write_prxfpreg (obfd, 
+                                              note_data, 
+                                              note_size, 
+                                              &fpxregs, 
+                                              sizeof (fpxregs));
+#endif
   return note_data;
 }
 
This page took 0.024031 seconds and 4 git commands to generate.