這應該服務器來說明問題。我本來想在Xcode中設置斷點,但指出了同樣的問題發生在我將它們LLDB的命令行:LLDB沒有在正確的行設置斷點
(lldb) list /Users/jim/Code/breakout-juce/Source/BalLGame.h:300
300 }
301 }
302
303 void handleCollision(const Object & other) override
304 {
305 if (other.getComponentID() == "paddle")
306 {
307 auto & paddle = dynamic_cast<const Paddle&>(other);
308
309 auto positionInPaddle = paddle.getLocalPoint(this, getLocalBounds().getCentre());
310 auto normal = paddle.getNormal(positionInPaddle.getX());
現在讓我在行設置斷點305
(lldb) break set -f /Users/jim/Code/breakout-juce/Source/BalLGame.h -l 305
Breakpoint 4: where = Buzz`Ball::getDamage() const + 12 at BalLGame.h:341, address = 0x00000001000018ac
但開溜 - 它現在是在行341
這是行341:
(lldb) list /Users/jim/Code/breakout-juce/Source/BalLGame.h:340
340
341 int getDamage() const { return damage; }
342
343 void tick() override
344 {
345 setBounds(getBounds().translated(getDirectionVector().x, getDirectionVector().y));
346 angle += deltaAngle;
347 }
348
349 bool isKilled() override { return killed; }
350
我們有調試符號:
(lldb) script lldb.target.module['/Users/jim/Code/breakout-juce/Builds/MacOSX/build/Debug/Buzz.app/Contents/MacOS/Buzz'].GetNumCompileUnits()
19
任何想法,接下來要檢查什麼?這是一個調試版本...我剛剛升級到最新的Xcode版本,但它在Xcode 6中的失敗方式也完全相同。
PS。以下是可愛編譯選項:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x C++ -arch x86_64的-fmessage長度= 0 -fdiagnostics-展示 - note-include-stack -fmacro-backtrace-limit = 0 -std = C++ 11 -Wno-trigraphs -fascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wnon-virtual -dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wwitch -Wno -unused-function -Wno-unused-label -Wno -unused-parameter -Wunused-variable -Wunused -value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool -conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wno -newline -eof -Wno -C++ 11-extensions -D_DEBUG = 1 -DDEBU G = 1 -DJUCER_XCODE_MAC_F6D2F4CF = 1 -DJUCE_APP_VERSION = 1.0.0 -DJUCE_APP_VERSION_HEX = 0x10000 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -fasm-blocks - fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version -min = 10.10 -g -fvisibility = hidden -fvisibility -inlines-hidden -Wno-sign-conversion -iquote/Users/jim/Library/Developer/Xcode/DerivedData/Buzz-gymosgfspfkofkhbahhngwelyhbv/Build/Intermediates/Buzz.build/Debug/Buzz.build/Buzz-generated-files.hmap -I/Users/jim/Library/Developer/Xcode/DerivedData/Buzz-gymosgfspfkofkhbahhngwelyhbv/Build/Intermediates/Buzz.build/Debug/Buzz.build/Buzz-own-target-headers.hmap -I/Users/jim/Library/Developer/Xcode/DerivedData/Buzz-gymosgfspfkofkhbahhngwelyhbv/Build/Intermediates/Buzz.build/Debug/Buzz。 build/Buzz-all-target-headers.hmap -iquote /Users/jim/Library/Developer/Xcode/DerivedData/Buzz-gymosgfspfkofkhbahhngwelyhbv/Build/Intermediates/Buzz.build/Debug/Buzz.build/Buzz-p roject-headers.hmap -I/Users/jim/Code/breakout-juce/Builds/MacOSX/build/Debug/include -I ../../ JuceLibraryCode -I ../../../ juce/modules -I/Users/jim/Library/Developer/Xcode/DerivedData/Buzz-gymosgfspfkofkhbahhngwelyhbv/Build/Intermediates/Buzz.build/Debug/Buzz.build/DerivedSources/x86_64 -I/Users/jim/Library/Developer/Xcode/DerivedData /Buzz-gymosgfspfkofkhbahhngwelyhbv/Build/Intermediates/Buzz.build/Debug/Buzz.build/DerivedSources -Wreorder -F/Users/jim/Code/breakout-juce/Builds/MacOSX/build/Debug -MMD -MT依賴關係-MF/Users/jim/Library/Developer/Xcode/DerivedData/Buzz-gymosgfspfkofkhbahhngwelyhbv/Build/Intermediates/Buzz.build/Debug/Buzz.build/Objects-normal/x86_64/BalLGame.d --serialize-diagnostics/Users/jim/Library /Developer/Xcode/DerivedData/Buzz-gymosgfspfkofkhbahhngwelyhbv/Build/Intermediates/Buzz.build/Debug/Buzz.build/Objects-normal/x86_64/BalLGame.dia -c/Users/jim/Code/breakout-juce/Source/BalLGame .cpp -o/Users/jim/Library/Developer/Xcode/DerivedData/Buzz-gymosgfspfkofkh bahhngwelyhbv/Build/Intermediates/Buzz.build/Debug/Buzz.build/Objects-normal/x86_64/BalLGame.o
你試過完全重建嗎?經常在這種奇怪的情況下幫助 – Codeguard
gdb是否更好地工作?目標是找出clang是否生成了錯誤的調試信息,或者如果lldb不好使用它。 –
@Codeguard試過......:/刪除了所有'派生數據'並重建以防萬一! – JCx