[問題] callstack for x86/x64

看板LinuxDev作者 (yshihyu)時間8年前 (2016/01/24 16:13), 編輯推噓1(103)
留言4則, 3人參與, 最新討論串1/1
https://gist.github.com/anonymous/3f2a1d658af451d1b9f6 // 程式碼 gcc -m32 -g test.c -o test objdump -dS test https://gist.github.com/anonymous/88ad40d047d19827b202 gcc -g test.c -o test objdump -dS test https://gist.github.com/anonymous/95e284285fc3f558c082 請問為什麼分析 call stack gcc 都會加上 -m32 , 看網路上講法x64函數參數是用register 傳遞, 這樣不能分析嗎? -m32 是記憶體傳遞? 如果不加上 -m32 在 x64 分析 call stack 會有什麼問題嗎? 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 175.180.119.89 ※ 文章網址: https://www.ptt.cc/bbs/LinuxDev/M.1453623238.A.1BE.html

01/24 17:19, , 1F
不行在64bits機子上用32bits的calling convention吧
01/24 17:19, 1F

01/24 17:34, , 2F
-m32是把程式編譯成32bit
01/24 17:34, 2F

01/24 22:09, , 3F
x86/x64 的 function call convention 不同,
01/24 22:09, 3F

01/24 22:10, , 4F
單純看你想看哪一種
01/24 22:10, 4F
文章代碼(AID): #1Mf8V66- (LinuxDev)