From 90a7e657ba3f922eae90d7f5497e3bf22b9520ab Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 7 Nov 2025 16:21:11 -0500 Subject: [PATCH] gdbhooks.py: add printers for analyzer types (supernode and exploded_node) Tested by hand; this leads to output like this: (gdb) p m_enode_for_diag $1 = (gdb) p m_enode_for_diag->get_supernode () $2 = gcc/ChangeLog: * gdbhooks.py (class AnaSupernodePrinter): New. (class AnaExplodedNodePrinter): New. (build_pretty_printer): Register the above. Signed-off-by: David Malcolm --- gcc/gdbhooks.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/gcc/gdbhooks.py b/gcc/gdbhooks.py index 4735d590e4d5..a58181002fd4 100644 --- a/gcc/gdbhooks.py +++ b/gcc/gdbhooks.py @@ -388,6 +388,32 @@ class CfgEdgePrinter: result += '>' return result +###################################################################### +# Pretty-printers for -fanalyzer (namespace ana) +###################################################################### + +class AnaSupernodePrinter: + def __init__(self, gdbval): + self.gdbval = gdbval + + def to_string (self): + result = '::node_t *'], + 'ana::exploded_node', + AnaExplodedNodePrinter) pp.add_printer_for_types(['edge', 'edge_def *'], 'edge', CfgEdgePrinter) -- 2.47.3