Skip to content

Instantly share code, notes, and snippets.

@daverigby
Created November 16, 2020 11:14
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 daverigby/803ce967aeb6b9eec7ce9e978de54251 to your computer and use it in GitHub Desktop.
Save daverigby/803ce967aeb6b9eec7ce9e978de54251 to your computer and use it in GitHub Desktop.
(gdb) disas
Dump of assembler code for function _ZN8phosphor8TraceLog14getChunkTenantEv:
=> 0x00007ff6391ec420 <+0>: push %r12
0x00007ff6391ec422 <+2>: push %rbp
0x00007ff6391ec423 <+3>: mov %rsi,%r12
0x00007ff6391ec426 <+6>: push %rbx
0x00007ff6391ec427 <+7>: mov %rdi,%rbx
0x00007ff6391ec42a <+10>: sub $0x10,%rsp
0x00007ff6391ec42e <+14>: data16 lea 0x208aca(%rip),%rdi # 0x7ff6393f4f00
0x00007ff6391ec436 <+22>: data16 data16 callq 0x7ff6391de2e0 <__tls_get_addr@plt>
0x00007ff6391ec43e <+30>: mov %rax,%rdi
0x00007ff6391ec441 <+33>: mov %rax,%rbp
0x00007ff6391ec444 <+36>: mov %rax,(%rsp)
0x00007ff6391ec448 <+40>: callq 0x7ff6391de320 <_ZN8phosphor9ChunkLock5slaveEv@plt>
0x00007ff6391ec44d <+45>: mov %rax,%rdi
0x00007ff6391ec450 <+48>: callq 0x7ff6391de2b0 <_ZN8phosphor14SlaveChunkLock8try_lockEv@plt>
0x00007ff6391ec455 <+53>: test %al,%al
0x00007ff6391ec457 <+55>: mov %al,0x8(%rsp)
0x00007ff6391ec45b <+59>: jne 0x7ff6391ec478 <_ZN8phosphor8TraceLog14getChunkTenantEv+88>
0x00007ff6391ec45d <+61>: movq $0x0,(%rbx)
0x00007ff6391ec464 <+68>: movb $0x0,0x8(%rbx)
0x00007ff6391ec468 <+72>: add $0x10,%rsp
0x00007ff6391ec46c <+76>: mov %rbx,%rax
0x00007ff6391ec46f <+79>: pop %rbx
0x00007ff6391ec470 <+80>: pop %rbp
0x00007ff6391ec471 <+81>: pop %r12
0x00007ff6391ec473 <+83>: retq
0x00007ff6391ec474 <+84>: nopl 0x0(%rax)
0x00007ff6391ec478 <+88>: mov 0x40(%rbp),%rdi
0x00007ff6391ec47c <+92>: test %rdi,%rdi
0x00007ff6391ec47f <+95>: je 0x7ff6391ec48a <_ZN8phosphor8TraceLog14getChunkTenantEv+106>
0x00007ff6391ec481 <+97>: callq 0x7ff6391de100 <_ZNK8phosphor10TraceChunk6isFullEv@plt>
0x00007ff6391ec486 <+102>: test %al,%al
0x00007ff6391ec488 <+104>: je 0x7ff6391ec4ef <_ZN8phosphor8TraceLog14getChunkTenantEv+207>
0x00007ff6391ec48a <+106>: movzbl 0x78(%r12),%eax
0x00007ff6391ec490 <+112>: test %al,%al
0x00007ff6391ec492 <+114>: jne 0x7ff6391ec4d0 <_ZN8phosphor8TraceLog14getChunkTenantEv+176>
0x00007ff6391ec494 <+116>: cmpb $0x0,0x8(%rsp)
0x00007ff6391ec499 <+121>: movq $0x0,(%rbx)
0x00007ff6391ec4a0 <+128>: movb $0x0,0x8(%rbx)
0x00007ff6391ec4a4 <+132>: je 0x7ff6391ec468 <_ZN8phosphor8TraceLog14getChunkTenantEv+72>
0x00007ff6391ec4a6 <+134>: mov (%rsp),%rdi
0x00007ff6391ec4aa <+138>: test %rdi,%rdi
0x00007ff6391ec4ad <+141>: je 0x7ff6391ec468 <_ZN8phosphor8TraceLog14getChunkTenantEv+72>
0x00007ff6391ec4af <+143>: callq 0x7ff6391de320 <_ZN8phosphor9ChunkLock5slaveEv@plt>
0x00007ff6391ec4b4 <+148>: mov %rax,%rdi
0x00007ff6391ec4b7 <+151>: callq 0x7ff6391de020 <_ZN8phosphor14SlaveChunkLock6unlockEv@plt>
0x00007ff6391ec4bc <+156>: add $0x10,%rsp
0x00007ff6391ec4c0 <+160>: mov %rbx,%rax
0x00007ff6391ec4c3 <+163>: pop %rbx
0x00007ff6391ec4c4 <+164>: pop %rbp
0x00007ff6391ec4c5 <+165>: pop %r12
0x00007ff6391ec4c7 <+167>: retq
0x00007ff6391ec4c8 <+168>: nopl 0x0(%rax,%rax,1)
0x00007ff6391ec4d0 <+176>: data16 lea 0x208a28(%rip),%rdi # 0x7ff6393f4f00
0x00007ff6391ec4d8 <+184>: data16 data16 callq 0x7ff6391de2e0 <__tls_get_addr@plt>
0x00007ff6391ec4e0 <+192>: mov %r12,%rdi
0x00007ff6391ec4e3 <+195>: mov %rax,%rsi
0x00007ff6391ec4e6 <+198>: callq 0x7ff6391de4c0 <_ZN8phosphor8TraceLog12replaceChunkERNS_11ChunkTenantE@plt>
0x00007ff6391ec4eb <+203>: test %al,%al
0x00007ff6391ec4ed <+205>: je 0x7ff6391ec510 <_ZN8phosphor8TraceLog14getChunkTenantEv+240>
0x00007ff6391ec4ef <+207>: mov (%rsp),%rax
0x00007ff6391ec4f3 <+211>: mov %rax,(%rbx)
0x00007ff6391ec4f6 <+214>: movzbl 0x8(%rsp),%eax
0x00007ff6391ec4fb <+219>: mov %al,0x8(%rbx)
0x00007ff6391ec4fe <+222>: add $0x10,%rsp
0x00007ff6391ec502 <+226>: mov %rbx,%rax
0x00007ff6391ec505 <+229>: pop %rbx
0x00007ff6391ec506 <+230>: pop %rbp
0x00007ff6391ec507 <+231>: pop %r12
0x00007ff6391ec509 <+233>: retq
0x00007ff6391ec50a <+234>: nopw 0x0(%rax,%rax,1)
0x00007ff6391ec510 <+240>: mov 0xb0(%r12),%rbp
0x00007ff6391ec518 <+248>: cmpb $0x0,0x8(%rsp)
0x00007ff6391ec51d <+253>: je 0x7ff6391ec54a <_ZN8phosphor8TraceLog14getChunkTenantEv+298>
0x00007ff6391ec51f <+255>: mov (%rsp),%rdi
0x00007ff6391ec523 <+259>: test %rdi,%rdi
0x00007ff6391ec526 <+262>: je 0x7ff6391ec53a <_ZN8phosphor8TraceLog14getChunkTenantEv+282>
0x00007ff6391ec528 <+264>: callq 0x7ff6391de320 <_ZN8phosphor9ChunkLock5slaveEv@plt>
0x00007ff6391ec52d <+269>: mov %rax,%rdi
0x00007ff6391ec530 <+272>: callq 0x7ff6391de020 <_ZN8phosphor14SlaveChunkLock6unlockEv@plt>
0x00007ff6391ec535 <+277>: movb $0x0,0x8(%rsp)
0x00007ff6391ec53a <+282>: mov %rbp,%rsi
0x00007ff6391ec53d <+285>: mov %r12,%rdi
0x00007ff6391ec540 <+288>: callq 0x7ff6391de360 <_ZN8phosphor8TraceLog10maybe_stopEm@plt>
0x00007ff6391ec545 <+293>: jmpq 0x7ff6391ec494 <_ZN8phosphor8TraceLog14getChunkTenantEv+116>
0x00007ff6391ec54a <+298>: mov $0x1,%edi
0x00007ff6391ec54f <+303>: callq 0x7ff6391ddcb0 <_ZSt20__throw_system_errori@plt>
0x00007ff6391ec554 <+308>: cmpb $0x0,0x8(%rsp)
0x00007ff6391ec559 <+313>: mov %rax,%rbx
0x00007ff6391ec55c <+316>: je 0x7ff6391ec566 <_ZN8phosphor8TraceLog14getChunkTenantEv+326>
0x00007ff6391ec55e <+318>: mov %rsp,%rdi
0x00007ff6391ec561 <+321>: callq 0x7ff6391dde00 <_ZNSt11unique_lockIN8phosphor11ChunkTenantEE6unlockEv@plt>
0x00007ff6391ec566 <+326>: mov %rbx,%rdi
0x00007ff6391ec569 <+329>: callq 0x7ff6391de3a0 <_Unwind_Resume@plt>
End of assembler dump.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment