tags:

views:

100

answers:

1

If I have something like bool operator ==(const uint128& x, const uint128& y); how can I get gdb to disassemble it?

+5  A: 
(gdb) p 'operator==(uint128 const&,uint128 const&)'
$1 = {bool (const uint128 &, const uint128 &)} 0x401040 <operator==(uint128 const&, uint128 const&)>
(gdb) disassemble $1
Dump of assembler code for function _ZeqRK7uint128S1_:
0x00401040 <_ZeqRK7uint128S1_+0>:       push   %ebp
... (elided)
0x00401066 <_ZeqRK7uint128S1_+38>:      ret    
End of assembler dump.
(gdb)
wrang-wrang
Gives me "unmatched single quote." I tried it with double quotes too and no quotes, no dice.
gct
Try it w/ "p" instead of disassemble. Then pass the address to disassemble.
wrang-wrang
How do I get the address of the function?
gct
Edited; see above.
wrang-wrang
Aha, yes indeed, I was including the variable names, that's the problem. Thanks!
gct