diff options
author | Joel Brobecker <brobecker@gnat.com> | 2013-05-16 07:02:42 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2013-05-16 07:02:42 +0000 |
commit | 4917f7eef3ad12d18fe0757ffda9de60ba556078 (patch) | |
tree | 83ff30daae37d68500a6578eb3fda5e998c15c18 /gdb | |
parent | e55999758aa986a1f3e55ad3e741e3d591e3b38a (diff) | |
download | gdb-4917f7eef3ad12d18fe0757ffda9de60ba556078.tar.gz |
Missing do_cleanups in ada_make_symbol_completion_list.
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.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/ada-lang.c | 2 | ||||
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/complete.exp | 17 |
4 files changed, 28 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a51543b6659..1685f541594 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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". diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 3510750db93..fa6db0f7411 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -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; } diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 5f12e2ec655..28e1e019974 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -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. diff --git a/gdb/testsuite/gdb.ada/complete.exp b/gdb/testsuite/gdb.ada/complete.exp index 973e20b8e14..91859085e06 100644 --- a/gdb/testsuite/gdb.ada/complete.exp +++ b/gdb/testsuite/gdb.ada/complete.exp @@ -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" + } + } + } +} |