zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: zsh-workers <zsh-workers@sunsite.dk>
Subject: valgrind completion, order of completed values
Date: Sun, 18 Oct 2009 13:26:13 +0200	[thread overview]
Message-ID: <237967ef0910180426i2a06405escda6007a0c9d3e87@mail.gmail.com> (raw)

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


             reply	other threads:[~2009-10-18 11:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-18 11:26 Mikael Magnusson [this message]
2011-05-23  0:21 ` PATCH: Update horrible hack for completing valgrind tools Mikael Magnusson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=237967ef0910180426i2a06405escda6007a0c9d3e87@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).