[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    valgrind/coregrind
From:       Dirk Mueller <mueller () kde ! org>
Date:       2005-07-18 10:49:48
Message-ID: 1121683788.131991.9518.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 435838 by mueller:

backport 4146 from valgrind 3.0 repository: 

Fixed bug #88678 -- debug info is now correctly gathered for files
containing spaces.



 M  +10 -5     vg_procselfmaps.c  


--- trunk/valgrind/coregrind/vg_procselfmaps.c #435837:435838
@@ -231,12 +231,17 @@
     read_line_ok:
 
       /* Try and find the name of the file mapped to this segment, if
-         it exists. */
-      while (procmap_buf[i] != '\n' && i < buf_n_tot-1) i++;
+         it exists.  Note that files can contains spaces. */
+
+      // Move i to the next non-space char, which should be either a '/' or
+      // a newline.
+      while (procmap_buf[i] == ' ' && i < buf_n_tot-1) i++;
+     
+      // Move i_eol to the end of the line.
       i_eol = i;
-      i--;
-      while (!VG_(isspace)(procmap_buf[i]) && i >= 0) i--;
-      i++;
+      while (procmap_buf[i_eol] != '\n' && i_eol < buf_n_tot-1) i_eol++;
+
+      // If there's a filename...
       if (i < i_eol-1 && procmap_buf[i] == '/') {
          /* Minor hack: put a '\0' at the filename end for the call to
             `record_mapping', then restore the old char with `tmp'. */
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic