]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/
authorYao Qi <yao@codesourcery.com>
Sat, 13 Apr 2013 14:14:08 +0000 (14:14 +0000)
committerYao Qi <yao@codesourcery.com>
Sat, 13 Apr 2013 14:14:08 +0000 (14:14 +0000)
* ctf.c (_initialize_ctf): Include "completer.h".
Call add_target_with_completer instead of add_target.

gdb/testsuite/

* gdb.base/completion.exp: Test completion of command
'target ctf' if target ctf is supported.

gdb/ChangeLog
gdb/ctf.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/completion.exp

index 969b11925810879990cacb10985edbea69e46ecc..48cbd0ee2578117f275294258bf9f8db13f2bd79 100644 (file)
@@ -1,3 +1,8 @@
+2013-04-13  Yao Qi  <yao@codesourcery.com>
+
+       * ctf.c (_initialize_ctf): Include "completer.h".
+       Call add_target_with_completer instead of add_target.
+
 2013-04-12  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        Fix GDB regression related to PR binutils/14813.
index 0985784ad40e939b301545e948a870978439deca..b8252e40fc567a0f4df071261b0aaf2d1456c387 100644 (file)
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -25,6 +25,7 @@
 #include "regcache.h"
 #include "gdb_stat.h"
 #include "exec.h"
+#include "completer.h"
 
 #include <ctype.h>
 
@@ -1843,6 +1844,6 @@ _initialize_ctf (void)
 #if HAVE_LIBBABELTRACE
   init_ctf_ops ();
 
-  add_target (&ctf_ops);
+  add_target_with_completer (&ctf_ops, filename_completer);
 #endif
 }
index 90a83b003a452ae06aa11abb972ced1f118f450f..93360a426c4078573657741455f5eae9c3356d60 100644 (file)
@@ -1,3 +1,8 @@
+2013-04-13  Yao Qi  <yao@codesourcery.com>
+
+       * gdb.base/completion.exp: Test completion of command
+       'target ctf' if target ctf is supported.
+
 2013-04-10  Pedro Alves  <palves@redhat.com>
 
        * gdb.base/completion.exp: Test "set height", "set listsize" and
index 008cb0a33a7b727e9385d51fd55be56a54fa3131..80cfbff60ad79fd9997f080eacdd7b2978d58841 100644 (file)
@@ -714,8 +714,19 @@ gdb_test "complete set gnutarget aut" "set gnutarget auto"
 gdb_test "complete set cp-abi aut" "set cp-abi auto"
 
 # Test that completion of commands 'target FOO' works well.
+set targets [list "core" "tfile" "exec"]
 
-foreach target_name { "core" "tfile" "exec" } {
+# Test that completion of command 'target ctf' if GDB supports ctf
+# target.
+gdb_test_multiple "target ctf" "" {
+    -re "Undefined target command: \"ctf\"\.  Try \"help target\"\.\r\n$gdb_prompt $" {
+    }
+    -re "No CTF directory specified.*\r\n$gdb_prompt $" {
+       lappend targets "ctf"
+    }
+}
+
+foreach target_name ${targets} {
     gdb_test "complete target ${target_name} ./gdb.base/completion" \
        "target ${target_name} ./gdb.base/completion\\.exp.*"
 }