看板 LinuxDev 關於我們 聯絡資訊
不好意思 回了有點久以前的問題 我也常碰到這問題 要 print 變數 卻碰上 no symbol "xxx" in current context 我有加 -g 參數 是在 constructor 裡面有差嗎? 現在碰到的例子是 我查不到 constructor 裡 for-loop 中的 local variable 其他像 member variable ctor 的 parameter 等等都查得到 前面有提到要查 scope 但我下 info scope XXX 也只出現 member variable 等等 ※ 引述《typecommand (:))》之銘言: : 我利用GDB在trace code時,想要看目前某個變數的值, : 但常常出現no symbol "xxx" in current context : 請問板上有那位大大遇到這種問題嗎? 謝謝大家。 -- Team Programming Dragon http://graphics.csie.ntu.edu.tw/~jonathan/tpd/ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 157.82.144.11
TroyLee:把-O拿掉? 12/02 20:36
eva19452002:只加-g是不夠滴,要加-gdwarf-2才能查的到 12/03 10:54