This revision was automatically updated to reflect the committed changes.
Closed by commit rL275060: Change the /proc/<pid>/maps to not assert on 
incorrect input (authored by tberghammer).

Changed prior to commit:
  http://reviews.llvm.org/D22211?vs=63485&id=63503#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D22211

Files:
  lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp

Index: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -1919,31 +1919,28 @@
     const char read_perm_char = line_extractor.GetChar ();
     if (read_perm_char == 'r')
         memory_region_info.SetReadable (MemoryRegionInfo::OptionalBool::eYes);
-    else
-    {
-        assert ( (read_perm_char == '-') && "unexpected /proc/{pid}/maps read 
permission char" );
+    else if (read_perm_char == '-')
         memory_region_info.SetReadable (MemoryRegionInfo::OptionalBool::eNo);
-    }
+    else
+        return Error ("unexpected /proc/{pid}/maps read permission char");
 
     // Handle write permission.
     const char write_perm_char = line_extractor.GetChar ();
     if (write_perm_char == 'w')
         memory_region_info.SetWritable (MemoryRegionInfo::OptionalBool::eYes);
-    else
-    {
-        assert ( (write_perm_char == '-') && "unexpected /proc/{pid}/maps 
write permission char" );
+    else if (write_perm_char == '-')
         memory_region_info.SetWritable (MemoryRegionInfo::OptionalBool::eNo);
-    }
+    else
+        return Error ("unexpected /proc/{pid}/maps write permission char");
 
     // Handle execute permission.
     const char exec_perm_char = line_extractor.GetChar ();
     if (exec_perm_char == 'x')
         memory_region_info.SetExecutable 
(MemoryRegionInfo::OptionalBool::eYes);
-    else
-    {
-        assert ( (exec_perm_char == '-') && "unexpected /proc/{pid}/maps exec 
permission char" );
+    else if (exec_perm_char == '-')
         memory_region_info.SetExecutable (MemoryRegionInfo::OptionalBool::eNo);
-    }
+    else
+        return Error ("unexpected /proc/{pid}/maps exec permission char");
 
     return Error ();
 }


Index: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -1919,31 +1919,28 @@
     const char read_perm_char = line_extractor.GetChar ();
     if (read_perm_char == 'r')
         memory_region_info.SetReadable (MemoryRegionInfo::OptionalBool::eYes);
-    else
-    {
-        assert ( (read_perm_char == '-') && "unexpected /proc/{pid}/maps read permission char" );
+    else if (read_perm_char == '-')
         memory_region_info.SetReadable (MemoryRegionInfo::OptionalBool::eNo);
-    }
+    else
+        return Error ("unexpected /proc/{pid}/maps read permission char");
 
     // Handle write permission.
     const char write_perm_char = line_extractor.GetChar ();
     if (write_perm_char == 'w')
         memory_region_info.SetWritable (MemoryRegionInfo::OptionalBool::eYes);
-    else
-    {
-        assert ( (write_perm_char == '-') && "unexpected /proc/{pid}/maps write permission char" );
+    else if (write_perm_char == '-')
         memory_region_info.SetWritable (MemoryRegionInfo::OptionalBool::eNo);
-    }
+    else
+        return Error ("unexpected /proc/{pid}/maps write permission char");
 
     // Handle execute permission.
     const char exec_perm_char = line_extractor.GetChar ();
     if (exec_perm_char == 'x')
         memory_region_info.SetExecutable (MemoryRegionInfo::OptionalBool::eYes);
-    else
-    {
-        assert ( (exec_perm_char == '-') && "unexpected /proc/{pid}/maps exec permission char" );
+    else if (exec_perm_char == '-')
         memory_region_info.SetExecutable (MemoryRegionInfo::OptionalBool::eNo);
-    }
+    else
+        return Error ("unexpected /proc/{pid}/maps exec permission char");
 
     return Error ();
 }
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to