From: Austin Clements Date: Mon, 22 Dec 2014 21:46:25 +0000 (-0500) Subject: liblink: code for debugging bad returns X-Git-Tag: go1.5beta1~2554 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6c78443b3e13c43ea887f6b73099e0c1297327c5;p=gostls13.git liblink: code for debugging bad returns Disabled by default, but invaluable when you need it. Change-Id: If4a75d11d14f70b6840d339aaec4b940dc406493 Reviewed-on: https://go-review.googlesource.com/2012 Reviewed-by: Russ Cox --- diff --git a/src/liblink/obj9.c b/src/liblink/obj9.c index a1ead3a0f3..2b6456d423 100644 --- a/src/liblink/obj9.c +++ b/src/liblink/obj9.c @@ -619,6 +619,22 @@ addstacksplit(Link *ctxt, LSym *cursym) p->link = q; p = q; + if(0) { + // Debug bad returns + q = ctxt->arch->prg(); + q->as = AMOVD; + q->lineno = p->lineno; + q->from.type = D_OREG; + q->from.offset = 0; + q->from.reg = REGTMP; + q->to.type = D_REG; + q->to.reg = REGTMP; + + q->link = p->link; + p->link = q; + p = q; + } + if(autosize) { q = ctxt->arch->prg(); q->as = AADD;