2013-07-27 24 views
4

我使用從cocos3d一個結構稱爲CC3IntPoint:爲什麼LLDB使用我的結構的錯誤字段進行算術?

typedef struct { 
    GLint x; /**< The X-componenent of the point. */ 
    GLint y; /**< The Y-componenent of the point. */ 
} CC3IntPoint; 

當我運行我的程序,它看起來正常的調試器:

(lldb) p pos 
(CC3IntPoint) $5 = { 
    (GLint) x = 48 
    (GLint) y = 91 
} 
(lldb) p pos.y 
(GLint) $6 = 91 

但是,如果我做任何數學上pos.y,它使用pos.x!例如:

(lldb) p pos.y+1 
(int) $7 = 49 
(lldb) p pos.y*1 
(int) $8 = 48 

我在這裏錯過了一些明顯的東西嗎?任何想法如何解決?

+0

...看起來像一個bug給我。 –

+0

這是什麼LLDB版本?你的結構是伊娃嗎? –

+0

XCode 4.6中的LLDB-179.1。 – kristina

回答

2

這看起來非常像一個錯誤。

請歸檔。

我會說這是某種指針算術魔術,但我無法想象是這種情況。

如果你真的想探討這個問題,我會建議抓住各種子擴展的地址,並看看你是否能找到它在哪裏決定抓錯誤的領域。

查看Jason對原始問題的評論;這應該是真正的答案。

相關問題