From: stevenknight Date: Thu, 21 Feb 2002 17:31:10 +0000 (+0000) Subject: Fix the --debug=pdb option on Windows. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a04662753dd3c6328c6715ca677cea4678d28c04;p=scons.git Fix the --debug=pdb option on Windows. git-svn-id: http://scons.tigris.org/svn/scons/trunk@273 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/CHANGES.txt b/src/CHANGES.txt index c30e8712..4643b9a3 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -71,6 +71,8 @@ RELEASE 0.05 - - Fix the -c option so it doesn't stop removing targets if one doesn't already exist. + - Fix the --debug=pdb option when run on Windows NT. + From Steve Leblanc: - Add support for the -u option. diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index aa4ecb4e..529729ea 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -376,18 +376,16 @@ def options_init(): def opt_debug(opt, arg): global print_tree if arg == "pdb": - if sys.platform == 'win32': - lib_dir = os.path.join(sys.exec_prefix, "lib") - else: - lib_dir = os.path.join(sys.exec_prefix, - "lib", - "python" + sys.version[0:3]) - args = [ sys.executable, os.path.join(lib_dir, "pdb.py") ] + \ + args = [ sys.executable, "pdb.py" ] + \ filter(lambda x: x != "--debug=pdb", sys.argv) if sys.platform == 'win32': - ret = os.spawnve(os.P_WAIT, cmd_interp, args, env) - sys.exit(ret) + args[1] = os.path.join(sys.exec_prefix, "lib", "pdb.py") + sys.exit(os.spawnve(os.P_WAIT, args[0], args, os.environ)) else: + args[1] = os.path.join(sys.exec_prefix, + "lib", + "python" + sys.version[0:3], + "pdb.py") os.execvpe(args[0], args, os.environ) elif arg == "tree": print_tree = 1 diff --git a/test/option--debug.py b/test/option--debug.py index 304b8bdf..35a3f066 100644 --- a/test/option--debug.py +++ b/test/option--debug.py @@ -85,10 +85,14 @@ tree = """ +-foo.h """ % (foo, obj,obj) -assert string.find(test.stdout(), tree) != -1 +test.fail_test(string.find(test.stdout(), tree) == -1) test.run(arguments = "--debug=tree " + foo) -assert string.find(test.stdout(), tree) != -1 +test.fail_test(string.find(test.stdout(), tree) == -1) + +test.run(arguments = "--debug=pdb", stdin = "n\ns\nq\n") +test.fail_test(string.find(test.stdout(), "(Pdb)") == -1) +test.fail_test(string.find(test.stdout(), "scons") == -1) test.pass_test()