Avatar
omochimetaru 9/19/2018 2:52 PM
はい
2:52 PM
/usr/local/bin/python /Users/omochi/work/swift-source/swift/utils/line-directive \ @/Users/omochi/work/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/stdlib/public/core/WkKut.txt -- \ /Users/omochi/work/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/./bin/swiftc -c \ -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk \ -target x86_64-apple-macosx10.9 \ -resource-dir /Users/omochi/work/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/./lib/swift \ -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/../../../Developer/Library/Frameworks \ -Onone -g -D INTERNAL_CHECKS_ENABLED -D SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS \ -I /Users/omochi/work/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/./lib/swift/macosx/x86_64 \ -module-cache-path /Users/omochi/work/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/./module-cache -no-link-objc-runtime \ -Xfrontend -enable-resilience -nostdimport -parse-stdlib -module-name Swift \ -Xfrontend -group-info-path -Xfrontend /Users/omochi/work/swift-source/swift/stdlib/public/core/GroupInfo.json \ -swift-version 5 -warn-swift3-objc-inference-complete -Xfrontend -verify-syntax-tree \ -Xllvm -sil-inline-generics -Xllvm -sil-partial-specialization -Xfrontend -enable-sil-ownership \ -Xcc -DswiftCore_EXPORTS -warn-implicit-overrides -module-link-name swiftCore -force-single-frontend-invocation \ -Xcc -D__SWIFT_CURRENT_DYLIB=swiftCore -parse-as-library \ -o Swift.o \ @/Users/omochi/work/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/stdlib/public/core/WkKut.txt (edited)
2:52 PM
元のコマンドはこれで
2:53 PM
C->performJobs に入って、その中で posix_spawnに到達します
2:55 PM
#0 0x00000001033edfaa in swift::sys::Task::execute() at /Users/omochi/work/swift-source/swift/lib/Basic/Unix/TaskQueue.inc:198 #1 0x00000001033f0301 in TaskMonitor::beginExecutingATask(swift::sys::Task&) at /Users/omochi/work/swift-source/swift/lib/Basic/Unix/TaskQueue.inc:504 #2 0x00000001033eebf3 in TaskMonitor::startUpSomeTasks() at /Users/omochi/work/swift-source/swift/lib/Basic/Unix/TaskQueue.inc:477 #3 0x00000001033ee7a3 in TaskMonitor::executeTasks() at /Users/omochi/work/swift-source/swift/lib/Basic/Unix/TaskQueue.inc:451 #4 0x00000001033f106f in swift::sys::TaskQueue::execute(std::__1::function<void (int, void*)>, std::__1::function<swift::sys::TaskFinishedResponse (int, int, llvm::StringRef, llvm::StringRef, swift::sys::TaskProcessInformation, void*)>, std::__1::function<swift::sys::TaskFinishedResponse (int, llvm::StringRef, llvm::StringRef, llvm::StringRef, void*, llvm::Optional<int>, swift::sys::TaskProcessInformation)>) at /Users/omochi/work/swift-source/swift/lib/Basic/Unix/TaskQueue.inc:678 #5 0x000000010036431a in swift::driver::PerformJobsState::runTaskQueueToCompletion() at /Users/omochi/work/swift-source/swift/lib/Driver/Compilation.cpp:1089 #6 0x0000000100361333 in swift::driver::Compilation::performJobsImpl(bool&, std::__1::unique_ptr<swift::sys::TaskQueue, std::__1::default_delete<swift::sys::TaskQueue> >&&) at /Users/omochi/work/swift-source/swift/lib/Driver/Compilation.cpp:1388 #7 0x00000001003675ec in swift::driver::Compilation::performJobs(std::__1::unique_ptr<swift::sys::TaskQueue, std::__1::default_delete<swift::sys::TaskQueue> >&&) at /Users/omochi/work/swift-source/swift/lib/Driver/Compilation.cpp:1501 #8 0x0000000100334d61 in run_driver(llvm::StringRef, llvm::ArrayRef<char const*>) at /Users/omochi/work/swift-source/swift/tools/driver/driver.cpp:176 #9 0x0000000100332632 in main at /Users/omochi/work/swift-source/swift/tools/driver/driver.cpp:246
2:55 PM
// Spawn the subtask. int spawnErr = posix_spawn(&Pid, ExecPath, &FileActions, nullptr, const_cast<char **>(argvp), const_cast<char **>(envp));
2:55 PM
スタックトレースは↑で、この行に到達する。
2:56 PM
int Compilation::performJobs(std::unique_ptr<TaskQueue> &&TQ) { において、冒頭のperformSingleCommandに突入するif文をすり抜けるのが
2:56 PM
決定的な分岐かな。