[hellogcc] Re: Fwd: Why running the next command will jump back to the previous line position

  • From: Yao Qi <qiyaoltc@xxxxxxxxx>
  • To: hellogcc@xxxxxxxxxxxxx
  • Date: Sat, 29 Oct 2011 21:35:35 +0800

On Sat, Oct 29, 2011 at 03:17:28PM +0800, asmwarrior wrote:
> 这个问题困扰我很久了,就是调试的时候,gdb的运行行,为什么会回跳到前面定义变量的地方??
> 我已经发到gdb邮件列表了,希望这里也有人能帮忙看看,谢谢。
> 
> Hi, I'm using MinGW 4.6.2 and GDB cvs head under Windows XP.

这样的问题就是gcc在产生 debug info 不是很准确造成的。我没有办法在我的
gcc 4.4 上重现这个问题,但是我相信这个问题是存在的。

在dwarf里边,.debug_line这个段是用来记录把地址映射回到源代码
行号的。你可以用 readelf -wl 1.exe 看看,就能看明白。这样的问题一般
都是gcc 产生的debug info不对,虽然在也是gcc的bug,但是这样的bug优先级
比较低,所以,可能没有人修吧。

-- 
Yao Qi <qiyaoltc AT gmail DOT com>

The very ink with which all history is written is merely fluid prejudice.
                -- Mark Twain

Other related posts: