diff options
author | David Chase <drchase@google.com> | 2018-01-03 17:14:55 -0500 |
---|---|---|
committer | David Chase <drchase@google.com> | 2018-04-04 22:11:34 +0000 |
commit | 619679a3971fad8ff4aa231d7942c95579ceff23 (patch) | |
tree | ebda97b14b5d1820e6607416040a81ba384f07de /src/cmd/compile/internal/ssa/html.go | |
parent | 542ea5ad91367d2b40589942cc5757a4d5f43f97 (diff) | |
download | go-619679a3971fad8ff4aa231d7942c95579ceff23.tar.gz go-619679a3971fad8ff4aa231d7942c95579ceff23.zip |
cmd/compile: add IsStmt breakpoint info to src.lico
Add IsStmt information to src.lico so that suitable lines
for breakpoints (or not) can be noted, eventually for
communication to the debugger via the linker and DWARF.
The expectation is that the front end will apply statement
boundary marks because it has best information about the
input, and the optimizer will attempt to preserve these.
The exact method for placing these marks is still TBD;
ideally stopping "at" line N in unoptimized code will occur
at a point where none of the side effects of N have occurred
and all of the inputs for line N can still be observed.
The optimizer will work with the same markings supplied
for unoptimized code.
It is a goal that non-optimizing compilation should conserve
statement marks.
The optimizer will also use the not-a-statement annotation
to indicate instructions that have a line number (for
profiling purposes) but should not be the target of
debugger step, next, or breakpoints. Because instructions
marked as statements are sometimes removed, a third value
indicating that a position (instruction) can serve as a
statement if the optimizer removes the current instruction
marked as a statement for the same line. The optimizer
should attempt to conserve statement marks, but it is not
a bug if some are lost.
Includes changes to html output for GOSSAFUNC to indicate
not-default is-a-statement with bold and not-a-statement
with strikethrough.
Change-Id: Ia22c9a682f276e2ca2a4ef7a85d4b6ebf9c62b7f
Reviewed-on: https://go-review.googlesource.com/93663
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/html.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/html.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/ssa/html.go b/src/cmd/compile/internal/ssa/html.go index 47f37f2337..85d97ba497 100644 --- a/src/cmd/compile/internal/ssa/html.go +++ b/src/cmd/compile/internal/ssa/html.go @@ -370,7 +370,7 @@ func (v *Value) LongHTML() string { linenumber := "<span class=\"line-number\">(?)</span>" if v.Pos.IsKnown() { - linenumber = fmt.Sprintf("<span class=\"line-number\">(%d)</span>", v.Pos.Line()) + linenumber = fmt.Sprintf("<span class=\"line-number\">(%s)</span>", v.Pos.LineNumberHTML()) } s += fmt.Sprintf("%s %s = %s", v.HTML(), linenumber, v.Op.String()) @@ -434,7 +434,7 @@ func (b *Block) LongHTML() string { if b.Pos.IsKnown() { // TODO does not begin to deal with the full complexity of line numbers. // Maybe we want a string/slice instead, of outer-inner when inlining. - s += fmt.Sprintf(" (line %d)", b.Pos.Line()) + s += fmt.Sprintf(" (line %s)", b.Pos.LineNumberHTML()) } return s } |