From 73b766f1a3c31662a20e0de56c794319a0b20abc Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Wed, 15 Jul 2020 16:01:02 -0500 Subject: [PATCH] probe views: show last label name --- src/ide/views.ts | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/ide/views.ts b/src/ide/views.ts index fa28f906..5c48f27d 100644 --- a/src/ide/views.ts +++ b/src/ide/views.ts @@ -1099,9 +1099,19 @@ abstract class ProbeBitmapViewBase extends ProbeViewBase { x = x|0; y = y|0; var s = ""; + var lastroutine = null; + var lastcol = -1; this.redraw( (op,addr,col,row,clk,value) => { - if (y == row && x == col) { - s += "\n" + this.opToString(op, addr, value); + if (op == ProbeFlags.EXECUTE) { + lastroutine = this.addr2symbol(addr) || lastroutine; + } + if (row == y && col <= x) { + if (col != lastcol) { + s = ""; + lastcol = col; + } + if (s == "" && lastroutine) { s += "\n" + lastroutine; } + s += "\n" + this.opToString(op, addr, value); } } ); return 'X: ' + x + ' Y: ' + y + ' ' + s; @@ -1147,20 +1157,23 @@ export class AddressHeatMapView extends ProbeBitmapViewBase implements ProjectVi getTooltipText(x:number, y:number) : string { var a = (x & 0xff) + (y << 8); - var s = this.addr2str(a); + var s = ""; var pc = -1; var already = {}; + var lastroutine = null; this.redraw( (op,addr,col,row,clk,value) => { if (op == ProbeFlags.EXECUTE) { pc = addr; + lastroutine = this.addr2symbol(addr) || lastroutine; } var key = op|pc; if (addr == a && !already[key]) { - s += "\nPC " + this.addr2str(pc) + " " + this.opToString(op, null, value); - already[key] = 1; + if (s == "" && lastroutine) { s += "\n" + lastroutine; } + s += "\nPC " + this.addr2str(pc) + " " + this.opToString(op, null, value); + already[key] = 1; } } ); - return s; + return this.addr2str(a) + s; } }