Missing do_cleanups in ada_make_symbol_completion_list.
authorJoel Brobecker <brobecker@gnat.com>
Thu, 16 May 2013 07:02:43 +0000 (07:02 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Thu, 16 May 2013 07:02:43 +0000 (07:02 +0000)
This results in an internal-warning when trying the completion
when in Ada mode:

    (gdb) b simple<TAB>
    /[...]/cleanups.c:265: internal-warning: restore_my_cleanups has found a stale cleanup
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    Quit this debugging session? (y or n)

gdb/ChangeLog:

        * ada-lang.c (ada_make_symbol_completion_list): Make sure
        all cleanups are done before returning from this function.

gdb/testsuite/ChangeLog:

        * gdb.ada/complete.exp: Add test verifying completion using
        the "tab" key.

gdb/ChangeLog
gdb/ada-lang.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/complete.exp

index a51543b6659d31b6b5a3d6475104dd6b4d99fb99..1685f5415948ab9e99b5a868c1ba9c68ebaf8cfe 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-16  Joel Brobecker  <brobecker@adacore.com>
+
+       * ada-lang.c (ada_make_symbol_completion_list): Make sure
+       all cleanups are done before returning from this function.
+
 2013-05-15  Joel Brobecker  <brobecker@adacore.com>
 
        * utils.h: #include "exceptions.h".
index 3510750db93a60e6b4ce89bcb2f76a6303a94791..fa6db0f7411eb78479ac2f8ce9498f090f332215 100644 (file)
@@ -5841,6 +5841,7 @@ ada_make_symbol_completion_list (const char *text0, const char *word,
   struct block *b, *surrounding_static_block = 0;
   int i;
   struct block_iterator iter;
+  struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
 
   gdb_assert (code == TYPE_CODE_UNDEF);
 
@@ -5941,6 +5942,7 @@ ada_make_symbol_completion_list (const char *text0, const char *word,
     }
   }
 
+  do_cleanups (old_chain);
   return completions;
 }
 
index 5f12e2ec655776f7e3bbd0dc3a3f1c8480bf7f8e..28e1e019974381174914786e8ba04ee7fdf89bca 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-16  Joel Brobecker  <brobecker@adacore.com>
+
+       * gdb.ada/complete.exp: Add test verifying completion using
+       the "tab" key.
+
 2013-05-15  Pedro Alves  <palves@redhat.com>
 
        * gdb.base/fixsection.c: Remove attribution.
index 973e20b8e14006c7c60a043518108829b252c192..91859085e066347c606aa816f573f7285e16c80d 100644 (file)
@@ -175,4 +175,19 @@ test_gdb_complete "pck." \
 test_gdb_complete "<pck__my" \
                   "p <pck__my_global_variable>"
 
-
+# Very simple completion, but using the interactive form, this time.
+# The verification we are trying to make involves the event loop,
+# and using the "complete" command is not sufficient to reproduce
+# the original problem.
+set test "interactive complete 'print some'"
+send_gdb "print some\t"
+gdb_test_multiple "" "$test" {
+    -re "^print some_local_variable $" {
+        send_gdb "\n"
+        gdb_test_multiple "" "$test" {
+            -re " = 1$eol$gdb_prompt $" {
+                pass "$test"
+            }
+        }
+    }
+}
This page took 0.04828 seconds and 4 git commands to generate.