* extension.c (eval_ext_lang_from_control_command): Avoid dereferencing
authorDoug Evans <xdje42@gmail.com>
Sat, 22 Mar 2014 06:44:39 +0000 (02:44 -0400)
committerDoug Evans <xdje42@gmail.com>
Sat, 22 Mar 2014 06:44:39 +0000 (02:44 -0400)
NULL pointer.

testsuite/
* gdb.python/python.exp (python not supported): Verify multi-line
python command issues an error.

gdb/ChangeLog
gdb/extension.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.python/python.exp

index 0aec7b923040f8cff2d8f30680d1ac2b290dc6ae..a1e8c34a3f181c09f9d0c05b7fbd9df581f14c0e 100644 (file)
@@ -1,3 +1,8 @@
+2014-03-21  Daniel Gutson  <daniel.gutson@tallertechnologies.com>
+
+       * extension.c (eval_ext_lang_from_control_command): Avoid dereferencing
+       NULL pointer.
+
 2014-03-21  Pedro Alves  <palves@redhat.com>
 
        * infrun.c (normal_stop): Extend comment.
index c2f502b830573d9ad4f7b773e72c3ff9b7d87739..1146cc7d03c552aa64445b78d0fcc4da091c8018 100644 (file)
@@ -342,7 +342,8 @@ eval_ext_lang_from_control_command (struct command_line *cmd)
     {
       if (extlang->cli_control_type == cmd->control_type)
        {
-         if (extlang->ops->eval_from_control_command != NULL)
+         if (extlang->ops != NULL
+             && extlang->ops->eval_from_control_command != NULL)
            {
              extlang->ops->eval_from_control_command (extlang, cmd);
              return;
index aad07fdb54a050b86a65aa89e5bf50ef5fc91243..f1f06799e9d4222eebdc1aff41a2a6f485377341 100644 (file)
@@ -1,3 +1,8 @@
+2014-03-22  Doug Evans  <xdje42@gmail.com>
+
+       * gdb.python/python.exp (python not supported): Verify multi-line
+       python command issues an error.
+
 2014-03-21  Maciej W. Rozycki  <macro@codesourcery.com>
 
        * gdb.threads/thread-specific.exp: Handle the lack of usable
index a470427fd80775d0140f6f3b10822df30f02d9c7..5b8d34a0ab2e3f3c42dbaf71bcddf722a05854e1 100644 (file)
@@ -41,6 +41,13 @@ gdb_test_multiple "python print (23)" "verify python support" {
       gdb_test "source $srcdir/$subdir/source2.py" \
          "Error in sourced command file:.*" \
          "source source2.py when python disabled"
+
+      # Verify multi-line python commands cause an error.
+      gdb_py_test_multiple "multi-line python command" \
+         "python" "" \
+         "print (23)" "" \
+         "end" "not supported.*"
+
       return -1
     }
     -re "$gdb_prompt $"        {}