* Align file names in weblist disassembly The disassembly displayed by weblist attempts to align file:line information after each instruction, but two things interfere with this alignment: 1) the instruction text often has tabs in it, which defeats the length-based alignment and generally interacts poorly with HTML rendering and 2) the instruction text often has special HTML characters like < and > in it, but we pad the string after escaping it, so the length is again not representative of how it will display. For example, the following shows what this looks like for disassembly that contains < and >: . . 41c634: cmp $0x200,%rdx mgcsweepbuf.go:130 . . 41c63b: jae 41c64f <runtime.(*gcSweepBuf).pop+0x4f> mgcsweepbuf.go:130 . . 41c63d: mov (%rax,%rdx,8),%rcx mgcsweepbuf.go:130 . . 41c64f: callq 424800 <runtime.panicindex> mgcsweepbuf.go:130 . . 41c654: ud2 mgcsweepbuf.go:130 Fix these problems by replacing tab characters with spaces and padding the string before escaping it. After this, the file names are properly aligned: . . 41c634: cmp $0x200,%rdx mgcsweepbuf.go:130 . . 41c63b: jae 41c64f <runtime.(*gcSweepBuf).pop+0x4f> mgcsweepbuf.go:130 . . 41c63d: mov (%rax,%rdx,8),%rcx mgcsweepbuf.go:130 . . 41c64f: callq 424800 <runtime.panicindex> mgcsweepbuf.go:130 . . 41c654: ud2 mgcsweepbuf.go:130 * Separate discontiguous assembly blocks Currently, weblist's disassembled output for each line simply lists all instructions that are marked with that line number. This leads to confusing disassembly because a lot of things look like straight-line control flow when they aren't. For example, index panics look like they always happen: . . 41c62c: test %al,(%rax) . . 41c62e: and $0x1ff,%edx . . 41c634: cmp $0x200,%rdx . . 41c63b: jae 41c64f <runtime.(*gcSweepBuf).pop+0x4f> . . 41c63d: mov (%rax,%rdx,8),%rcx . . 41c64f: callq 424800 <runtime.panicindex> . . 41c654: ud2 In reality, 41c64f is at the end of the function, but it looks like we call it immediately after a successful index operation. Fix this by adding a vertical ellipses to separate blocks of assembly that have other instructions between them. With this change, the above looks like: . . 41c62c: test %al,(%rax) . . 41c62e: and $0x1ff,%edx . . 41c634: cmp $0x200,%rdx . . 41c63b: jae 41c64f <runtime.(*gcSweepBuf).pop+0x4f> . . 41c63d: mov (%rax,%rdx,8),%rcx ⋮ . . 41c64f: callq 424800 <runtime.panicindex> . . 41c654: ud2
|
||
1063 | 1063 |
|
1064 | 1064 |
|
1065 | 1065 |
|
1066 |
|
|
1067 |
|
|
1068 |
|
|
1069 |
|
|
1066 |
|
|
1067 |
|
|
1068 |
|
|
1069 |
|
|
1070 | 1070 |
|
1071 | 1071 |
|
1072 | 1072 |
|
|
||
2 | 2 |
|
3 | 3 |
|
4 | 4 |
|
5 |
|
|
6 |
|
|
7 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 | 8 |
|
9 | 9 |
|
10 | 10 |
|
|
||
2 | 2 |
|
3 | 3 |
|
4 | 4 |
|
5 |
|
|
5 | 6 |
|
6 | 7 |
|
7 | 8 |
|
|
||
70 | 71 |
|
71 | 72 |
|
72 | 73 |
|
73 |
|
|
74 |
|
|
75 |
|
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
|
76 | 79 |
|
77 |
|
|
78 | 80 |
|
79 | 81 |
|
80 | 82 |
|
81 | 83 |
|
84 |
|
|
82 | 85 |
|
83 | 86 |
|
84 | 87 |
|
|
||
532 | 532 |
|
533 | 533 |
|
534 | 534 |
|
535 |
|
|
535 | 536 |
|
536 | 537 |
|
537 | 538 |
|
|
||
236 | 236 |
|
237 | 237 |
|
238 | 238 |
|
239 |
|
|
239 | 240 |
|
240 | 241 |
|
241 | 242 |
|
242 | 243 |
|
243 | 244 |
|
245 |
|
|
246 |
|
|
247 |
|
|
248 |
|
|
249 |
|
|
250 |
|
|
244 | 251 |
|
245 | 252 |
|
246 | 253 |
|
|
||
306 | 313 |
|
307 | 314 |
|
308 | 315 |
|
309 |
|
|
316 |
|
|
317 |
|
|
318 |
|
|
319 |
|
|
320 |
|
|
321 |
|
|
310 | 322 |
|
311 | 323 |
|
312 | 324 |
|
|
||
322 | 334 |
|
323 | 335 |
|
324 | 336 |
|
325 |
|
|
337 |
|
|
326 | 338 |
|
327 | 339 |
|
328 |
|
|
340 |
|
|
329 | 341 |
|
330 | 342 |
|
331 | 343 |
|
|
||
18 | 18 |
|
19 | 19 |
|
20 | 20 |
|
21 |
|
|
21 | 22 |
|
22 | 23 |
|
23 | 24 |
|