(v Value)
| 69 | } |
| 70 | |
| 71 | func (r *reader) emitDebugRef(v Value) { |
| 72 | if v == nil { |
| 73 | panic("nil") |
| 74 | } |
| 75 | |
| 76 | if !r.bool() { |
| 77 | return // blank, const, or predeclared |
| 78 | } |
| 79 | |
| 80 | e := r.exprTODO() |
| 81 | isAddr := r.bool() |
| 82 | var obj Object |
| 83 | if r.bool() { |
| 84 | obj = r.obj() |
| 85 | } |
| 86 | |
| 87 | if !r.b.debugInfo() { |
| 88 | // TODO(mdempsky): Allow skipping reading the expr/obj |
| 89 | // entirely in this case? |
| 90 | return // debugging not enabled |
| 91 | } |
| 92 | r.b.emit(&DebugRef{ |
| 93 | X: v, |
| 94 | Expr: e, |
| 95 | IsAddr: isAddr, |
| 96 | object: obj, |
| 97 | }) |
| 98 | } |