diff --git a/bin/spack b/bin/spack
index ec6a80ff0248d0f1473b4c4b172b4d008de4ce13..a0b260ccaf331e201982c83c7ac2c9f380f60a3d 100755
--- a/bin/spack
+++ b/bin/spack
@@ -89,6 +89,8 @@ spec expressions:
 
 parser.add_argument('-d', '--debug', action='store_true',
                     help="Write out debug logs during compile")
+parser.add_argument('-D', '--pdb', action='store_true',
+                    help="Run spack under the pdb debugger")
 parser.add_argument('-k', '--insecure', action='store_true',
                     help="Do not check ssl certificates when downloading.")
 parser.add_argument('-m', '--mock', action='store_true',
@@ -159,5 +161,8 @@ def main():
 if args.profile:
     import cProfile
     cProfile.run('main()', sort='tottime')
+elif args.pdb:
+    import pdb
+    pdb.run('main()')
 else:
     main()