From 0a36f5f21cd9dcaaf99e78d2ec995d6cb2918274 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 28 Oct 2020 20:07:35 -0400 Subject: [PATCH] analyzer: fix more pointer-printing in logs gcc/analyzer/ChangeLog: * program-state.cc (sm_state_map::print): Guard the printing of the origin pointer with !flag_dump_noaddr. * region.cc (string_region::dump_to_pp): Likewise for m_string_cst. --- gcc/analyzer/program-state.cc | 7 +++++-- gcc/analyzer/region.cc | 9 ++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/gcc/analyzer/program-state.cc b/gcc/analyzer/program-state.cc index 6a91554357c..7d719b1a6da 100644 --- a/gcc/analyzer/program-state.cc +++ b/gcc/analyzer/program-state.cc @@ -224,8 +224,11 @@ sm_state_map::print (const region_model *model, if (e.m_origin) { pp_string (pp, " (origin: "); - pp_pointer (pp, e.m_origin); - pp_string (pp, ": "); + if (!flag_dump_noaddr) + { + pp_pointer (pp, e.m_origin); + pp_string (pp, ": "); + } e.m_origin->dump_to_pp (pp, simple); if (model) if (tree rep = model->get_representative_tree (e.m_origin)) diff --git a/gcc/analyzer/region.cc b/gcc/analyzer/region.cc index c43fb782b7d..ed68a2240f3 100644 --- a/gcc/analyzer/region.cc +++ b/gcc/analyzer/region.cc @@ -1135,9 +1135,12 @@ string_region::dump_to_pp (pretty_printer *pp, bool simple) const { pp_string (pp, "string_region("); dump_tree (pp, m_string_cst); - pp_string (pp, " ("); - pp_pointer (pp, m_string_cst); - pp_string (pp, "))"); + if (!flag_dump_noaddr) + { + pp_string (pp, " ("); + pp_pointer (pp, m_string_cst); + pp_string (pp, "))"); + } } } -- 2.30.2