From d46b2a32ae7b368a156e4fd99cd0d9ee45efe4e8 Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Thu, 13 Jul 2023 10:52:49 +0200 Subject: [PATCH] Dataflow: Improve debug printing. --- .../code/java/dataflow/internal/DataFlowImpl.qll | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll index ac85ae06c1d..5c493c418b4 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll @@ -2706,7 +2706,7 @@ module Impl { ParamNodeEx getParamNode() { result = p } - override string toString() { result = p + ": " + ap } + override string toString() { result = p + concat(" : " + ppReprType(t)) + " " + ap } predicate hasLocationInfo( string filepath, int startline, int startcolumn, int endline, int endcolumn @@ -3092,6 +3092,12 @@ module Impl { result = " <" + this.(PathNodeMid).getCallContext().toString() + ">" } + private string ppSummaryCtx() { + this instanceof PathNodeSink and result = "" + or + result = " <" + this.(PathNodeMid).getSummaryCtx().toString() + ">" + } + /** Gets a textual representation of this element. */ string toString() { result = this.getNodeEx().toString() + this.ppType() + this.ppAp() } @@ -3100,7 +3106,9 @@ module Impl { * representation of the call context. */ string toStringWithContext() { - result = this.getNodeEx().toString() + this.ppType() + this.ppAp() + this.ppCtx() + result = + this.getNodeEx().toString() + this.ppType() + this.ppAp() + this.ppCtx() + + this.ppSummaryCtx() } /**