Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

valgrind completion, order of completed values



I noticed the --read-var-info option wasn't completed and went to add
it, when I noticed the completion function has (yes no), but when
completing the no comes first, presumably alphabetical sorting is done
somewhere. This is also a bit weird for ones like (low med high) and
(no some all). Is there any way to work around that? I also noticed
--leak-resolution was missing the description so (low med high) was
actually displayed as the description and nothing was completed.
Here's a patch for these two.

diff --git a/Completion/Linux/Command/_valgrind
b/Completion/Linux/Command/_valgrind
index 3da65e9..486010b 100644
--- a/Completion/Linux/Command/_valgrind
+++ b/Completion/Linux/Command/_valgrind
@@ -20,6 +20,10 @@ common=(
   '--alignment=-[set minimum alignment of allocations]:number'
 )

+common_read_varinfo=(
+  '--read-var-info=-[read DWARF3 debug info]:enable:(yes no)'
+)
+
 common_mem_null=(
   '--xml=-[output everything in XML]:enable:(yes no)'
   '--xml-user-comment=-[copy specified string verbatim to XML output]:string'
@@ -31,13 +35,14 @@ args_addrcheck=(
   '--partial-loads-ok=-:enable:(yes no)'
   '--freelist-vol=-[volume of freed blocks queue]:blocks'
   '--leak-check=-[search for memory leaks at exit]:enable:(yes no)'
-  '--leak-resolution=-[how much bt merging in leak check]:(low med high)'
+  '--leak-resolution=-[how much bt merging in leak check]:level:(low med high)'
   '--show-reachable=-[show reachable blocks in leak check]:enable:(yes no)'
   '--workaround-gcc296-bugs=-:enable:(yes no)'
 )

 args_memcheck=(
   $args_addrcheck
+  $common_read_varinfo
 )

 args_cachegrind=(
@@ -48,6 +53,7 @@ args_cachegrind=(

 args_helgrind=(
   $common
+  $common_read_varinfo
   '--private-stacks=-[assume thread stacks are used privately]:enable:(yes no)'
   '--show-last-access=-[show location of last word access on
error]:locations:(no some all)'
 )






I also noticed --tool no longer works, it seems the files have
-x86-linux appended to them, so I tried this fix, but :s doesn't do
anything.

@@ -112,7 +118,7 @@ if [[ -n "$state" ]]; then
   # Basically uses debug output to find out the directory where the tools are
   # present and lists all executables in that directory.
   # Hope the program provides a neater interface some day!
-  tools=(${${${(M)${(f)"$(_call_program tools valgrind
--tool=something -d 2> /dev/null)"}:#*launcher launching
*something}##*launcher launching }%%something}*(*:t))
+  tools=(${${${(M)${(f)"$(_call_program tools valgrind
--tool=something -d 2>&1)"}:#*launcher launching
*something*}##*launcher launching }%%something*}*~*.so(*:t:s/-*//))
   _wanted tools exl 'valgrind tool' compadd $tools && return
 fi

if I run it at the command prompt, it does work though, and I can't
recall any option that turns off :s// there.

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author