[Lldb-commits] [lldb] r176611 - Stop the "module" property from throwing an exception when the module name was not found in the target module list.

Greg Clayton gclayton at apple.com
Wed Mar 6 18:58:47 PST 2013


Author: gclayton
Date: Wed Mar  6 20:58:47 2013
New Revision: 176611

URL: http://llvm.org/viewvc/llvm-project?rev=176611&view=rev
Log:
Stop the "module" property from throwing an exception when the module name was not found in the target module list.


Modified:
    lldb/trunk/scripts/Python/interface/SBTarget.i

Modified: lldb/trunk/scripts/Python/interface/SBTarget.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBTarget.i?rev=176611&r1=176610&r2=176611&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBTarget.i (original)
+++ lldb/trunk/scripts/Python/interface/SBTarget.i Wed Mar  6 20:58:47 2013
@@ -751,12 +751,15 @@ public:
                             if module.file.fullpath == key:
                                 return module
                     # See if the string is a UUID
-                    the_uuid = uuid.UUID(key)
-                    if the_uuid:
-                        for idx in range(num_modules):
-                            module = self.sbtarget.GetModuleAtIndex(idx)
-                            if module.uuid == the_uuid:
-                                return module
+                    try:
+                        the_uuid = uuid.UUID(key)
+                        if the_uuid:
+                            for idx in range(num_modules):
+                                module = self.sbtarget.GetModuleAtIndex(idx)
+                                if module.uuid == the_uuid:
+                                    return module
+                    except:
+                        return None
                 elif type(key) is uuid.UUID:
                     for idx in range(num_modules):
                         module = self.sbtarget.GetModuleAtIndex(idx)





More information about the lldb-commits mailing list