[RuntimeDyld] Teach MachOObjectImage to deregister itself with the debugger upon
authorLang Hames <lhames@gmail.com>
Thu, 26 Jun 2014 23:05:44 +0000 (23:05 +0000)
committerLang Hames <lhames@gmail.com>
Thu, 26 Jun 2014 23:05:44 +0000 (23:05 +0000)
destruction the same way ELFObjectImage does.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211815 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp

index 5b96371880beb5791ba319f008348ad1df6ba464..71b914d49056f2334090717158173efa0de17b5f 100644 (file)
@@ -65,7 +65,10 @@ public:
     initOldAddress();
   }
 
-  virtual ~MachOObjectImage() {}
+  virtual ~MachOObjectImage() {
+    if (Registered)
+      deregisterWithDebugger();
+  }
 
   // Subclasses can override these methods to update the image with loaded
   // addresses for sections and common symbols