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/internal/obj | |
| parent | 542ea5ad91367d2b40589942cc5757a4d5f43f97 (diff) | |
| download | go-619679a3971fad8ff4aa231d7942c95579ceff23.tar.xz | |
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/internal/obj')
| -rw-r--r-- | src/cmd/internal/obj/util.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/cmd/internal/obj/util.go b/src/cmd/internal/obj/util.go index 9b25231bb4..c540533cba 100644 --- a/src/cmd/internal/obj/util.go +++ b/src/cmd/internal/obj/util.go @@ -21,11 +21,13 @@ func (p *Prog) Line() string { // InnermostLineNumber returns a string containing the line number for the // innermost inlined function (if any inlining) at p's position func (p *Prog) InnermostLineNumber() string { - pos := p.Ctxt.InnermostPos(p.Pos) - if !pos.IsKnown() { - return "?" - } - return fmt.Sprintf("%d", pos.Line()) + return p.Ctxt.InnermostPos(p.Pos).LineNumber() +} + +// InnermostLineNumberHTML returns a string containing the line number for the +// innermost inlined function (if any inlining) at p's position +func (p *Prog) InnermostLineNumberHTML() string { + return p.Ctxt.InnermostPos(p.Pos).LineNumberHTML() } // InnermostFilename returns a string containing the innermost |
