From 12a22606f9ed6d5578bc6e9b3675a1f6e382625a Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 28 May 2019 20:22:16 +0000 Subject: [PATCH] Fix GDB pretty printer for Optional after r354246 llvm-svn: 361870 --- utils/gdb-scripts/prettyprinters.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/utils/gdb-scripts/prettyprinters.py b/utils/gdb-scripts/prettyprinters.py index 7ddc33acb20..55f2b369319 100644 --- a/utils/gdb-scripts/prettyprinters.py +++ b/utils/gdb-scripts/prettyprinters.py @@ -129,8 +129,7 @@ class OptionalPrinter(Iterator): self.val = None if not val['Storage']['hasVal']: raise StopIteration - return ('value', val['Storage']['storage']['buffer'].address.cast( - val.type.template_argument(0).pointer()).dereference()) + return ('value', val['Storage']['value']) def to_string(self): return 'llvm::Optional{}'.format('' if self.val['Storage']['hasVal'] else ' is not initialized')