• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

TextMate is a graphical text editor for OS X 10.7+


Commit MetaInfo

Revisión218551185bc1724caffbb15e0b428b726e6fd253 (tree)
Tiempo2012-08-16 06:23:24
AutorAllan Odgaard <git@abet...>
CommiterAllan Odgaard

Log Message

Add gdb targets to build.ninja

Since ninja run each build job with its own stdin/out/err we can’t launch gdb itself in a build job, so we use osascript to launch gdb in a new window.

I used Terminal for this only because it is simpler to script than iTerm2.

Cambiar Resumen

Diferencia incremental

--- a/bin/gen_build
+++ b/bin/gen_build
@@ -444,10 +444,12 @@ def static_executable(target)
444444 libs = prepend('-l', all_values_for_key(target, 'LIBS'))
445445 res << " RAVE_FLAGS = #{fws} #{libs}\n"
446446
447- res << "build #{dst}.run: run_executable #{dst}\n"
447+ res << "build #{dst}.run: run_executable #{dst}\n"
448+ res << "build #{dst}.debug: debug_executable #{dst}\n"
448449
449- res << "build #{target[:name]}: phony #{dst}\n"
450- res << "build #{target[:name]}/run: phony #{dst}.run\n"
450+ res << "build #{target[:name]}: phony #{dst}\n"
451+ res << "build #{target[:name]}/run: phony #{dst}.run\n"
452+ res << "build #{target[:name]}/debug: phony #{dst}.debug\n"
451453
452454 res
453455 end
@@ -510,12 +512,14 @@ def app_bundle(target)
510512
511513 res << "build #{dst}: phony | #{deps.join(' ')}\n"
512514
513- res << "build #{dst}.sign: sign_executable #{dst}\n"
514- res << "build #{dst}.run: run_application #{dst} | #{dst}.sign\n"
515+ res << "build #{dst}.sign: sign_executable #{dst}\n"
516+ res << "build #{dst}.run: run_application #{dst} | #{dst}.sign\n"
515517 res << " appname = #{target[:name]}\n"
518+ res << "build #{dst}.debug: debug_executable #{dst}/Contents/MacOS/#{target[:name]}\n"
516519
517- res << "build #{target[:name]}: phony #{dst}.sign\n"
518- res << "build #{target[:name]}/run: phony #{dst}.run\n"
520+ res << "build #{target[:name]}: phony #{dst}.sign\n"
521+ res << "build #{target[:name]}/run: phony #{dst}.run\n"
522+ res << "build #{target[:name]}/debug: phony #{dst}.debug\n"
519523
520524 target[:rsrc_info] = all_files
521525
@@ -662,6 +666,7 @@ open("#{builddir}/build.ninja", "w") do |io|
662666 io << "\n"
663667 io << "build run: phony #{variables.find { |k, _| k == 'APP_NAME' }.last}/run\n"
664668 io << "build deploy: phony #{variables.find { |k, _| k == 'APP_NAME' }.last}/deploy\n"
669+ io << "build debug: phony #{variables.find { |k, _| k == 'APP_NAME' }.last}/debug\n"
665670 io << "default run\n"
666671 end
667672
@@ -712,6 +717,10 @@ rule run_executable
712717 command = $in
713718 description = Run ‘$in’…
714719
720+rule debug_executable
721+ command = osascript >/dev/null -e $$'tell app "Terminal" \n activate \n do script "gdb $in" \n end tell'
722+ description = Debug ‘$in’…
723+
715724 rule run_application
716725 command = { $
717726 if pgrep -q "$appname"; then $