Why does `disassemble` behave differently on Linux and Mac?
Peng Yu
pengyu.ut@gmail.com
Sun Jan 24 16:01:05 GMT 2021
Adding -g to gcc make `disassemble func` works. Why is it required on
Mac but not on Linux?
On 1/24/21, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Sun, 24 Jan 2021 09:06:10 -0600
>> From: Peng Yu via Gdb <gdb@sourceware.org>
>>
>> $ gcc -c func.c
>> $ gdb -q func.o
>> Reading symbols from func.o...
>> (No debugging symbols found in func.o)
>> (gdb) show disassembly-flavor
>> The disassembly flavor is "att".
>> (gdb) disassemble func
>> No symbol table is loaded. Use the "file" command.
>
> I think you need to compile with -g.
>
--
Regards,
Peng
More information about the Gdb
mailing list