[Mlir-commits] [mlir] e851e56 - [mlir] Fix TypeID lookup in GDB pretty printers.

Christian Sigg llvmlistbot at llvm.org
Mon Oct 26 23:12:43 PDT 2020


Author: Christian Sigg
Date: 2020-10-27T07:12:32+01:00
New Revision: e851e566d4aee6770ac4f347b80373492d46e674

URL: https://github.com/llvm/llvm-project/commit/e851e566d4aee6770ac4f347b80373492d46e674
DIFF: https://github.com/llvm/llvm-project/commit/e851e566d4aee6770ac4f347b80373492d46e674.diff

LOG: [mlir] Fix TypeID lookup in GDB pretty printers.

The TypeID instance was moved in D89153.

It wasn't caught that it broke MLIR pretty printers because pre-merge checks don't run check-debuginfo.

Avoid disabling all MLIR printers in case this happens again by catching the exception.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D90191

Added: 
    

Modified: 
    mlir/utils/gdb-scripts/prettyprinters.py

Removed: 
    


################################################################################
diff  --git a/mlir/utils/gdb-scripts/prettyprinters.py b/mlir/utils/gdb-scripts/prettyprinters.py
index 39246bf6446e..6dd97c60f1e5 100644
--- a/mlir/utils/gdb-scripts/prettyprinters.py
+++ b/mlir/utils/gdb-scripts/prettyprinters.py
@@ -103,8 +103,12 @@ def _init_map(self):
     self.map = {}
     for type_name in self.type_names:
       concrete_type = gdb.lookup_type(type_name)
-      storage = gdb.parse_and_eval(
-          "&'mlir::TypeID::get<%s>()::instance'" % type_name)
+      try:
+        storage = gdb.parse_and_eval(
+            "&'mlir::detail::TypeIDExported::get<%s>()::instance'" % type_name)
+      except gdb.error:
+        # Skip when TypeID instance cannot be found in current context.
+        continue
       if concrete_type and storage:
         self.map[int(storage)] = concrete_type
 


        


More information about the Mlir-commits mailing list