mrw string now throws exceptions, catch needed
This commit is contained in:
		@@ -9,6 +9,9 @@
 | 
				
			|||||||
    @license LGPL, see file <a href="license.html">COPYING</a>
 | 
					    @license LGPL, see file <a href="license.html">COPYING</a>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $Log$
 | 
					    $Log$
 | 
				
			||||||
 | 
					    Revision 1.8  2004/12/20 13:22:25  marc
 | 
				
			||||||
 | 
					    mrw string now throws exceptions, catch needed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Revision 1.7  2004/10/13 10:47:15  marc
 | 
					    Revision 1.7  2004/10/13 10:47:15  marc
 | 
				
			||||||
    no more need for ldd in StackTrace, read from /proc/self/maps
 | 
					    no more need for ldd in StackTrace, read from /proc/self/maps
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -257,14 +260,14 @@ mrw::StackTrace::BinFiles mrw::StackTrace::filename()
 | 
				
			|||||||
    std::ifstream is("/proc/self/maps");
 | 
					    std::ifstream is("/proc/self/maps");
 | 
				
			||||||
    std::string s;
 | 
					    std::string s;
 | 
				
			||||||
    std::string range, perm, x1, x2, size, lib;
 | 
					    std::string range, perm, x1, x2, size, lib;
 | 
				
			||||||
    while (getline(is, s)) {
 | 
					    while (getline(is, s)) try {
 | 
				
			||||||
      range = perm = x1 = x2 = size = lib = "????";
 | 
					      range = perm = x1 = x2 = size = lib = "????";
 | 
				
			||||||
      s>>range>>perm>>x1>>x2>>size>>lib;
 | 
					      s>>range>>perm>>x1>>x2>>size>>lib;
 | 
				
			||||||
      range.resize(range.find_first_not_of("0123456789abcdefABCDEF"));
 | 
					      range.resize(range.find_first_not_of("0123456789abcdefABCDEF"));
 | 
				
			||||||
      void* addr(0);
 | 
					      void* addr(0);
 | 
				
			||||||
      range>>addr;
 | 
					      range>>addr;
 | 
				
			||||||
      if (lib.size() && addr>0) res<<BinFiles::value_type(lib, addr);
 | 
					      if (lib.size() && addr>0) res<<BinFiles::value_type(lib, addr);
 | 
				
			||||||
    }
 | 
					    } catch (...) {} // ignore non matching lines
 | 
				
			||||||
    return res;
 | 
					    return res;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
#   else
 | 
					#   else
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user