Skip to content

Instantly share code, notes, and snippets.

@mattn
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattn/03a6511221287494b8ac to your computer and use it in GitHub Desktop.
Save mattn/03a6511221287494b8ac to your computer and use it in GitHub Desktop.
"".foo t=1 size=224 value=0 args=0x10 locals=0x24
0x0000 00000 (strr.go:7) TEXT "".foo(SB), $36-16
0x0000 00000 (strr.go:7) MOVL TLS, CX
0x0007 00007 (strr.go:7) MOVL (CX)(TLS*2), CX
0x000d 00013 (strr.go:7) CMPL SP, 8(CX)
0x0010 00016 (strr.go:7) JHI 25
0x0012 00018 (strr.go:7) CALL runtime.morestack_noctxt(SB)
0x0017 00023 (strr.go:7) JMP 0
0x0019 00025 (strr.go:7) SUBL $36, SP
0x001c 00028 (strr.go:7) FUNCDATA $0, gclocals·3b541b66231ffea97692b3ca9c5e0ac4(SB)
0x001c 00028 (strr.go:7) FUNCDATA $1, gclocals·1b586b681d778adcef5b823cc3e98176(SB)
0x001c 00028 (strr.go:7) MOVL $0, BX
0x001e 00030 (strr.go:7) MOVL BX, "".~r0+40(FP)
0x0022 00034 (strr.go:7) MOVL BX, "".~r0+44(FP)
0x0026 00038 (strr.go:7) MOVL $0, BX
0x0028 00040 (strr.go:7) MOVL BX, "".~r1+48(FP)
0x002c 00044 (strr.go:7) MOVL BX, "".~r1+52(FP)
0x0030 00048 (strr.go:8) MOVL $go.string."foo"+8(SB), BX
0x0035 00053 (strr.go:8) MOVL BX, errors.text·2+28(SP)
0x0039 00057 (strr.go:8) MOVL $3, errors.text·2+32(SP)
0x0041 00065 (strr.go:8) MOVL $0, BX
0x0043 00067 (strr.go:8) MOVL BX, "".~r0+20(SP)
0x0047 00071 (strr.go:8) MOVL BX, "".~r0+24(SP)
0x004b 00075 (strr.go:8) MOVL $type.errors.errorString(SB), (SP)
0x0052 00082 (strr.go:8) PCDATA $0, $1
0x0052 00082 (strr.go:8) CALL runtime.newobject(SB)
0x0057 00087 (strr.go:8) MOVL 4(SP), AX
0x005b 00091 (strr.go:8) MOVL AX, "".autotmp_0001+16(SP)
0x005f 00095 (strr.go:8) MOVL AX, (SP)
0x0062 00098 (strr.go:8) CMPL (SP), $0
0x0066 00102 (strr.go:8) JEQ $1, 205
0x0068 00104 (strr.go:8) MOVL errors.text·2+28(SP), BX
0x006c 00108 (strr.go:8) MOVL BX, 4(SP)
0x0070 00112 (strr.go:8) MOVL errors.text·2+32(SP), BX
0x0074 00116 (strr.go:8) MOVL BX, 8(SP)
0x0078 00120 (strr.go:8) PCDATA $0, $2
0x0078 00120 (strr.go:8) CALL runtime.writebarrierstring(SB)
0x007d 00125 (strr.go:8) MOVL "".autotmp_0001+16(SP), BX
0x0081 00129 (strr.go:8) MOVL BX, "".autotmp_0000+16(SP)
0x0085 00133 (strr.go:8) MOVL go.itab.*errors.errorString.error(SB), AX
0x008b 00139 (strr.go:8) MOVL $0, BP
0x008d 00141 (strr.go:8) CMPL AX, BP
0x008f 00143 (strr.go:8) JEQ $1, 171
0x0091 00145 (strr.go:8) MOVL "".autotmp_0000+16(SP), CX
0x0095 00149 (strr.go:8) NOP
0x0095 00149 (strr.go:8) MOVL $0, BX
0x0097 00151 (strr.go:8) MOVL BX, "".~r0+40(FP)
0x009b 00155 (strr.go:8) MOVL BX, "".~r0+44(FP)
0x009f 00159 (strr.go:8) MOVL AX, "".~r1+48(FP)
0x00a3 00163 (strr.go:8) MOVL CX, "".~r1+52(FP)
0x00a7 00167 (strr.go:8) ADDL $36, SP
0x00aa 00170 (strr.go:8) RET
0x00ab 00171 (strr.go:8) MOVL $type.*errors.errorString(SB), (SP)
0x00b2 00178 (strr.go:8) MOVL $type.error(SB), 4(SP)
0x00ba 00186 (strr.go:8) MOVL $go.itab.*errors.errorString.error(SB), 8(SP)
0x00c2 00194 (strr.go:8) PCDATA $0, $2
0x00c2 00194 (strr.go:8) CALL runtime.typ2Itab(SB)
0x00c7 00199 (strr.go:8) MOVL 12(SP), AX
0x00cb 00203 (strr.go:8) JMP 145
0x00cd 00205 (strr.go:8) MOVL AX, 0
0x00d3 00211 (strr.go:8) JMP 104
0x0000 64 8b 0d 14 00 00 00 8b 89 00 00 00 00 3b 61 08 d............;a.
0x0010 77 07 e8 00 00 00 00 eb e7 83 ec 24 31 db 89 5c w..........$1..\
0x0020 24 28 89 5c 24 2c 31 db 89 5c 24 30 89 5c 24 34 $(.\$,1..\$0.\$4
0x0030 bb 00 00 00 00 89 5c 24 1c c7 44 24 20 03 00 00 ......\$..D$ ...
0x0040 00 31 db 89 5c 24 14 89 5c 24 18 c7 04 24 00 00 .1..\$..\$...$..
0x0050 00 00 e8 00 00 00 00 8b 44 24 04 89 44 24 10 89 ........D$..D$..
0x0060 04 24 83 3c 24 00 74 65 8b 5c 24 1c 89 5c 24 04 .$.<$.te.\$..\$.
0x0070 8b 5c 24 20 89 5c 24 08 e8 00 00 00 00 8b 5c 24 .\$ .\$.......\$
0x0080 10 89 5c 24 10 8b 05 00 00 00 00 31 ed 39 e8 74 ..\$.......1.9.t
0x0090 1a 8b 4c 24 10 31 db 89 5c 24 28 89 5c 24 2c 89 ..L$.1..\$(.\$,.
0x00a0 44 24 30 89 4c 24 34 83 c4 24 c3 c7 04 24 00 00 D$0.L$4..$...$..
0x00b0 00 00 c7 44 24 04 00 00 00 00 c7 44 24 08 00 00 ...D$......D$...
0x00c0 00 00 e8 00 00 00 00 8b 44 24 0c eb c4 89 05 00 ........D$......
0x00d0 00 00 00 eb 93 .....
rel 9+4 t=14 +0
rel 19+4 t=5 runtime.morestack_noctxt+0
rel 49+4 t=1 go.string."foo"+8
rel 78+4 t=1 type.errors.errorString+0
rel 83+4 t=5 runtime.newobject+0
rel 121+4 t=5 runtime.writebarrierstring+0
rel 135+4 t=1 go.itab.*errors.errorString.error+0
rel 174+4 t=1 type.*errors.errorString+0
rel 182+4 t=1 type.error+0
rel 190+4 t=1 go.itab.*errors.errorString.error+0
rel 195+4 t=5 runtime.typ2Itab+0
"".main t=1 size=272 value=0 args=0x0 locals=0x54
0x0000 00000 (strr.go:11) TEXT "".main(SB), $84-0
0x0000 00000 (strr.go:11) MOVL TLS, CX
0x0007 00007 (strr.go:11) MOVL (CX)(TLS*2), CX
0x000d 00013 (strr.go:11) CMPL SP, 8(CX)
0x0010 00016 (strr.go:11) JHI 25
0x0012 00018 (strr.go:11) CALL runtime.morestack_noctxt(SB)
0x0017 00023 (strr.go:11) JMP 0
0x0019 00025 (strr.go:11) SUBL $84, SP
0x001c 00028 (strr.go:11) FUNCDATA $0, gclocals·f6bd6b3389b872033d462029172c8612(SB)
0x001c 00028 (strr.go:11) FUNCDATA $1, gclocals·3a120051426c503e4c7d810e906dd77f(SB)
0x001c 00028 (strr.go:12) MOVL $0, BX
0x001e 00030 (strr.go:12) MOVL BX, "".~r0+36(SP)
0x0022 00034 (strr.go:12) MOVL BX, "".~r0+40(SP)
0x0026 00038 (strr.go:12) MOVL $0, BX
0x0028 00040 (strr.go:12) MOVL BX, "".~r1+20(SP)
0x002c 00044 (strr.go:12) MOVL BX, "".~r1+24(SP)
0x0030 00048 (strr.go:12) MOVL $go.string."foo"+8(SB), DX
0x0035 00053 (strr.go:12) MOVL $3, CX
0x003a 00058 (strr.go:12) MOVL $0, AX
0x003c 00060 (strr.go:12) MOVL AX, "".~r0+28(SP)
0x0040 00064 (strr.go:12) MOVL AX, "".~r0+32(SP)
0x0044 00068 (strr.go:12) LEAL "".autotmp_0007+76(SP), AX
0x0048 00072 (strr.go:12) MOVL $0, (AX)
0x004e 00078 (strr.go:12) MOVL $0, 4(AX)
0x0055 00085 (strr.go:12) LEAL "".autotmp_0007+76(SP), AX
0x0059 00089 (strr.go:12) CMPL AX, $0
0x005c 00092 (strr.go:12) JEQ $1, 254
0x0062 00098 (strr.go:12) MOVL DX, errors.text·2+44(SP)
0x0066 00102 (strr.go:12) MOVL DX, (AX)
0x0068 00104 (strr.go:12) MOVL CX, errors.text·2+48(SP)
0x006c 00108 (strr.go:12) MOVL CX, 4(AX)
0x006f 00111 (strr.go:12) MOVL AX, "".autotmp_0005+16(SP)
0x0073 00115 (strr.go:12) MOVL go.itab.*errors.errorString.error(SB), AX
0x0079 00121 (strr.go:12) MOVL $0, BP
0x007b 00123 (strr.go:12) CMPL AX, BP
0x007d 00125 (strr.go:12) JEQ $1, 220
0x007f 00127 (strr.go:12) MOVL "".autotmp_0005+16(SP), CX
0x0083 00131 (strr.go:12) MOVL AX, "".~r0+28(SP)
0x0087 00135 (strr.go:12) MOVL CX, "".~r0+32(SP)
0x008b 00139 (strr.go:12) MOVL $0, SI
0x008d 00141 (strr.go:12) MOVL AX, "".autotmp_0008+68(SP)
0x0091 00145 (strr.go:12) MOVL CX, "".autotmp_0008+72(SP)
0x0095 00149 (strr.go:12) MOVL SI, "".~r0+36(SP)
0x0099 00153 (strr.go:12) MOVL SI, "".autotmp_0011+60(SP)
0x009d 00157 (strr.go:12) MOVL SI, "".~r0+40(SP)
0x00a1 00161 (strr.go:12) MOVL SI, "".autotmp_0011+64(SP)
0x00a5 00165 (strr.go:12) MOVL AX, "".~r1+20(SP)
0x00a9 00169 (strr.go:12) MOVL AX, "".err+52(SP)
0x00ad 00173 (strr.go:12) MOVL CX, "".~r1+24(SP)
0x00b1 00177 (strr.go:12) MOVL CX, "".err+56(SP)
0x00b5 00181 (strr.go:13) PCDATA $0, $2
0x00b5 00181 (strr.go:13) CALL runtime.printlock(SB)
0x00ba 00186 (strr.go:13) MOVL "".err+52(SP), BX
0x00be 00190 (strr.go:13) MOVL BX, (SP)
0x00c1 00193 (strr.go:13) MOVL "".err+56(SP), BX
0x00c5 00197 (strr.go:13) MOVL BX, 4(SP)
0x00c9 00201 (strr.go:13) PCDATA $0, $3
0x00c9 00201 (strr.go:13) CALL runtime.printiface(SB)
0x00ce 00206 (strr.go:13) PCDATA $0, $3
0x00ce 00206 (strr.go:13) CALL runtime.printnl(SB)
0x00d3 00211 (strr.go:13) PCDATA $0, $3
0x00d3 00211 (strr.go:13) CALL runtime.printunlock(SB)
0x00d8 00216 (strr.go:15) ADDL $84, SP
0x00db 00219 (strr.go:15) RET
0x00dc 00220 (strr.go:12) MOVL $type.*errors.errorString(SB), (SP)
0x00e3 00227 (strr.go:12) MOVL $type.error(SB), 4(SP)
0x00eb 00235 (strr.go:12) MOVL $go.itab.*errors.errorString.error(SB), 8(SP)
0x00f3 00243 (strr.go:12) PCDATA $0, $1
0x00f3 00243 (strr.go:12) CALL runtime.typ2Itab(SB)
0x00f8 00248 (strr.go:12) MOVL 12(SP), AX
0x00fc 00252 (strr.go:12) JMP 127
0x00fe 00254 (strr.go:12) MOVL AX, (AX)
0x0100 00256 (strr.go:12) JMP 98
0x0000 64 8b 0d 14 00 00 00 8b 89 00 00 00 00 3b 61 08 d............;a.
0x0010 77 07 e8 00 00 00 00 eb e7 83 ec 54 31 db 89 5c w..........T1..\
0x0020 24 24 89 5c 24 28 31 db 89 5c 24 14 89 5c 24 18 $$.\$(1..\$..\$.
0x0030 ba 00 00 00 00 b9 03 00 00 00 31 c0 89 44 24 1c ..........1..D$.
0x0040 89 44 24 20 8d 44 24 4c c7 00 00 00 00 00 c7 40 .D$ .D$L.......@
0x0050 04 00 00 00 00 8d 44 24 4c 83 f8 00 0f 84 9c 00 ......D$L.......
0x0060 00 00 89 54 24 2c 89 10 89 4c 24 30 89 48 04 89 ...T$,...L$0.H..
0x0070 44 24 10 8b 05 00 00 00 00 31 ed 39 e8 74 5d 8b D$.......1.9.t].
0x0080 4c 24 10 89 44 24 1c 89 4c 24 20 31 f6 89 44 24 L$..D$..L$ 1..D$
0x0090 44 89 4c 24 48 89 74 24 24 89 74 24 3c 89 74 24 D.L$H.t$$.t$<.t$
0x00a0 28 89 74 24 40 89 44 24 14 89 44 24 34 89 4c 24 (.t$@.D$..D$4.L$
0x00b0 18 89 4c 24 38 e8 00 00 00 00 8b 5c 24 34 89 1c ..L$8......\$4..
0x00c0 24 8b 5c 24 38 89 5c 24 04 e8 00 00 00 00 e8 00 $.\$8.\$........
0x00d0 00 00 00 e8 00 00 00 00 83 c4 54 c3 c7 04 24 00 ..........T...$.
0x00e0 00 00 00 c7 44 24 04 00 00 00 00 c7 44 24 08 00 ....D$......D$..
0x00f0 00 00 00 e8 00 00 00 00 8b 44 24 0c eb 81 89 00 .........D$.....
0x0100 e9 5d ff ff ff .]...
rel 9+4 t=14 +0
rel 19+4 t=5 runtime.morestack_noctxt+0
rel 49+4 t=1 go.string."foo"+8
rel 117+4 t=1 go.itab.*errors.errorString.error+0
rel 182+4 t=5 runtime.printlock+0
rel 202+4 t=5 runtime.printiface+0
rel 207+4 t=5 runtime.printnl+0
rel 212+4 t=5 runtime.printunlock+0
rel 223+4 t=1 type.*errors.errorString+0
rel 231+4 t=1 type.error+0
rel 239+4 t=1 go.itab.*errors.errorString.error+0
rel 244+4 t=5 runtime.typ2Itab+0
"".init t=1 size=80 value=0 args=0x0 locals=0x0
0x0000 00000 (strr.go:15) TEXT "".init(SB), $0-0
0x0000 00000 (strr.go:15) MOVL TLS, CX
0x0007 00007 (strr.go:15) MOVL (CX)(TLS*2), CX
0x000d 00013 (strr.go:15) CMPL SP, 8(CX)
0x0010 00016 (strr.go:15) JHI 25
0x0012 00018 (strr.go:15) CALL runtime.morestack_noctxt(SB)
0x0017 00023 (strr.go:15) JMP 0
0x0019 00025 (strr.go:15) NOP
0x0019 00025 (strr.go:15) NOP
0x0019 00025 (strr.go:15) FUNCDATA $0, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
0x0019 00025 (strr.go:15) FUNCDATA $1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
0x0019 00025 (strr.go:15) MOVBLZX "".initdone·(SB), BX
0x0020 00032 (strr.go:15) CMPB BX, $0
0x0023 00035 (strr.go:15) JEQ 57
0x0025 00037 (strr.go:15) MOVBLZX "".initdone·(SB), BX
0x002c 00044 (strr.go:15) CMPB BX, $2
0x002f 00047 (strr.go:15) JNE 50
0x0031 00049 (strr.go:15) RET
0x0032 00050 (strr.go:15) PCDATA $0, $0
0x0032 00050 (strr.go:15) CALL runtime.throwinit(SB)
0x0037 00055 (strr.go:15) UNDEF
0x0039 00057 (strr.go:15) MOVB $1, "".initdone·(SB)
0x0040 00064 (strr.go:15) MOVB $2, "".initdone·(SB)
0x0047 00071 (strr.go:15) RET
0x0000 64 8b 0d 14 00 00 00 8b 89 00 00 00 00 3b 61 08 d............;a.
0x0010 77 07 e8 00 00 00 00 eb e7 0f b6 1d 00 00 00 00 w...............
0x0020 80 fb 00 74 14 0f b6 1d 00 00 00 00 80 fb 02 75 ...t...........u
0x0030 01 c3 e8 00 00 00 00 0f 0b c6 05 00 00 00 00 01 ................
0x0040 c6 05 00 00 00 00 02 c3 ........
rel 9+4 t=14 +0
rel 19+4 t=5 runtime.morestack_noctxt+0
rel 28+4 t=1 "".initdone·+0
rel 40+4 t=1 "".initdone·+0
rel 51+4 t=5 runtime.throwinit+0
rel 59+4 t=1 "".initdone·+0
rel 66+4 t=1 "".initdone·+0
go.itab.*errors.errorString.error t=23 dupok size=4 value=0
go.string."foo" t=7 dupok size=12 value=0
0x0000 00 00 00 00 03 00 00 00 66 6f 6f 00 ........foo.
rel 0+4 t=1 go.string."foo"+8
gclocals·1b586b681d778adcef5b823cc3e98176 t=7 dupok size=20 value=0
0x0000 03 00 00 00 0a 00 00 00 00 00 00 00 80 00 00 00 ................
0x0010 02 00 00 00 ....
gclocals·3b541b66231ffea97692b3ca9c5e0ac4 t=7 dupok size=20 value=0
0x0000 03 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 ................
0x0010 00 00 00 00 ....
gclocals·3a120051426c503e4c7d810e906dd77f t=7 dupok size=40 value=0
0x0000 04 00 00 00 22 00 00 00 00 00 00 00 00 00 00 00 ...."...........
0x0010 02 00 00 80 00 00 00 00 00 00 28 80 00 00 00 00 ..........(.....
0x0020 00 00 00 80 00 00 00 00 ........
gclocals·f6bd6b3389b872033d462029172c8612 t=7 dupok size=8 value=0
0x0000 04 00 00 00 00 00 00 00 ........
gclocals·33cdeccccebe80329f1fdbee7f5874cb t=7 dupok size=8 value=0
0x0000 01 00 00 00 00 00 00 00 ........
gclocals·33cdeccccebe80329f1fdbee7f5874cb t=7 dupok size=8 value=0
0x0000 01 00 00 00 00 00 00 00 ........
"".initdone· t=23 size=1 value=0
"".foo·f t=7 dupok size=4 value=0
0x0000 00 00 00 00 ....
rel 0+4 t=1 "".foo+0
runtime.newobject·f t=7 dupok size=4 value=0
0x0000 00 00 00 00 ....
rel 0+4 t=1 runtime.newobject+0
runtime.writebarrierstring·f t=7 dupok size=4 value=0
0x0000 00 00 00 00 ....
rel 0+4 t=1 runtime.writebarrierstring+0
runtime.typ2Itab·f t=7 dupok size=4 value=0
0x0000 00 00 00 00 ....
rel 0+4 t=1 runtime.typ2Itab+0
runtime.throwreturn·f t=7 dupok size=4 value=0
0x0000 00 00 00 00 ....
rel 0+4 t=1 runtime.throwreturn+0
"".main·f t=7 dupok size=4 value=0
0x0000 00 00 00 00 ....
rel 0+4 t=1 "".main+0
runtime.printlock·f t=7 dupok size=4 value=0
0x0000 00 00 00 00 ....
rel 0+4 t=1 runtime.printlock+0
runtime.printiface·f t=7 dupok size=4 value=0
0x0000 00 00 00 00 ....
rel 0+4 t=1 runtime.printiface+0
runtime.printnl·f t=7 dupok size=4 value=0
0x0000 00 00 00 00 ....
rel 0+4 t=1 runtime.printnl+0
runtime.printunlock·f t=7 dupok size=4 value=0
0x0000 00 00 00 00 ....
rel 0+4 t=1 runtime.printunlock+0
"".init·f t=7 dupok size=4 value=0
0x0000 00 00 00 00 ....
rel 0+4 t=1 "".init+0
runtime.throwinit·f t=7 dupok size=4 value=0
0x0000 00 00 00 00 ....
rel 0+4 t=1 runtime.throwinit+0
go.string."runtime" t=7 dupok size=16 value=0
0x0000 00 00 00 00 07 00 00 00 72 75 6e 74 69 6d 65 00 ........runtime.
rel 0+4 t=1 go.string."runtime"+8
go.importpath.runtime. t=7 dupok size=8 value=0
0x0000 00 00 00 00 07 00 00 00 ........
rel 0+4 t=1 go.string."runtime"+8
go.string."errors" t=7 dupok size=16 value=0
0x0000 00 00 00 00 06 00 00 00 65 72 72 6f 72 73 00 ........errors.
rel 0+4 t=1 go.string."errors"+8
go.importpath.errors. t=7 dupok size=8 value=0
0x0000 00 00 00 00 06 00 00 00 ........
rel 0+4 t=1 go.string."errors"+8
runtime.zerovalue t=7 dupok size=0 value=0
package main
import (
"errors"
)
func foo() (string, error) {
return "", errors.New("foo")
}
func main() {
_, err := foo()
println(err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment