Issue #10492: bdb.Bdb.run() only traces the execution of the code

And not the compilation (if the input is a string).
diff --git a/Lib/bdb.py b/Lib/bdb.py
index 9f5e7ae..f711004 100644
--- a/Lib/bdb.py
+++ b/Lib/bdb.py
@@ -385,6 +385,8 @@
         if locals is None:
             locals = globals
         self.reset()
+        if isinstance(cmd, str):
+            cmd = compile(cmd, "<string>", "exec")
         sys.settrace(self.trace_dispatch)
         try:
             exec(cmd, globals, locals)