看板 LinuxDev 關於我們 聯絡資訊
https://gist.github.com/anonymous/6a49e6e0982a4c1b59f7 $ gcc -o dbg-int3{,.c} -g && ./dbg-int3 Yes, real routines go here. 跟使用 gdb ./dbg-int3 (gdb) c Continuing. No, I don't want to serve you. 為什麼印出來結果不同? 是因為 GDB 的確會對 attached process 作 SIGTRAP handler 的攔截處理 所以程式的static void int3_handler(int signo) { being_debugged = 0; } 沒作用? http://blog.linux.org.tw/~jserv/archives/2010/08/ptrace_sigtrap.html 例子是Jserv網站 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 175.180.119.89 ※ 文章網址: https://www.ptt.cc/bbs/LinuxDev/M.1453627479.A.B94.html