From 78bec330f725b7c388697d22fa3754aa85f2d941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loi=CC=88c=20Correnson?= <loic.correnson@cea.fr> Date: Wed, 6 Jan 2021 17:07:51 +0100 Subject: [PATCH] [ivette/eva] fix callstack merging --- ivette/src/frama-c/eva/layout.ts | 24 ++++++++++++------------ ivette/src/frama-c/eva/model.ts | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ivette/src/frama-c/eva/layout.ts b/ivette/src/frama-c/eva/layout.ts index 2a46664ef23..ff4dbce4c97 100644 --- a/ivette/src/frama-c/eva/layout.ts +++ b/ivette/src/frama-c/eva/layout.ts @@ -80,18 +80,18 @@ export class LayoutEngine { } private static order(p: Probe, q: Probe): number { + const fp = p.fct; + const fq = q.fct; + if (fp === fq) { + const cp = p.byCallstacks; + const cq = q.byCallstacks; + if (!cp && cq) return (-1); + if (cp && !cq) return (+1); + } const rp = p.rank ?? 0; const rq = q.rank ?? 0; if (rp < rq) return (-1); if (rp > rq) return (+1); - const fp = p.fct; - const fq = q.fct; - if (fp < fq) return -1; - if (fp > fq) return +1; - const cp = p.byCallstacks; - const cq = q.byCallstacks; - if (!cp && cq) return (-1); - if (cp && !cq) return (+1); if (p.marker < q.marker) return (-1); if (p.marker > q.marker) return (+1); return 0; @@ -130,14 +130,14 @@ export class LayoutEngine { const summary = this.stacks.getSummary(fct); const callstacks = stacks.length; rs.push({ - key: `F${fct}`, + key: `F:${fct}`, kind: 'probes', probes: ps, stackCount: callstacks, hlines: 1, }); if (summary) rs.push({ - key: `M${fct}`, + key: `M:${fct}`, kind: 'values', probes: ps, stackIndex: -1, @@ -146,7 +146,7 @@ export class LayoutEngine { }); stacks.forEach((cs, k) => { rs.push({ - key: `C${fct}::${cs}`, + key: `C:${fct}:${cs}`, kind: 'callstack', probes: ps, stackIndex: k, @@ -156,7 +156,7 @@ export class LayoutEngine { }); }); } else { - // --- by callstacks + // --- not by callstacks const n = rs.length; rs.push({ key: `P${n}`, diff --git a/ivette/src/frama-c/eva/model.ts b/ivette/src/frama-c/eva/model.ts index 0b27005f939..6b96b41e8d3 100644 --- a/ivette/src/frama-c/eva/model.ts +++ b/ivette/src/frama-c/eva/model.ts @@ -38,6 +38,7 @@ export class Model implements ModelCallbacks { this.getRowCount = this.getRowCount.bind(this); this.getRowLines = this.getRowLines.bind(this); Server.onSignal(Values.changed, this.forceReload); + Server.onShutdown(this.forceReload); } // --- Probes @@ -52,7 +53,6 @@ export class Model implements ModelCallbacks { getFocused() { return this.focused; } isFocused(p: Probe | undefined) { return this.focused === p; } - isRemanent(p: Probe | undefined) { return this.remanent === p; } getProbe(fct: string, m: Ast.marker): Probe { let p = this.probes.get(m); -- GitLab