View Both Assembly and C code

前端 未结 3 1031
情歌与酒
情歌与酒 2021-01-30 04:06

Do we have a way to view assembly and c code both using gdb.

disassemble function_name shows only assembly, I was trying to find a way to easliy map c code to assembly.

3条回答
  •  遇见更好的自我
    2021-01-30 05:00

    For your purpose, try

    objdump -S 
    

    from man objdump:

    -S
    --source
     Display source code intermixed with disassembly, if possible.
     Implies -d.
    

提交回复
热议问题