On Чт, ноя 14, 2019 at 16:13, Alexander Monakov <amona...@ispras.ru> wrote:
On Thu, 14 Nov 2019, Konstantin Kharlamov wrote:

 Thanks! Unfortunately AFAIK ternary expressions are broken in gdb
 https://sourceware.org/bugzilla/show_bug.cgi?id=22466 :c

Indeed, I didn't notice that. But it still would be nice to avoid duplicating
the commands over and over again. Can we use something like

  define pp
  if $argc
   p $arg0
  end
  call debug ($)
  end

this way

  pp something

is simply equivalent to what people already use:

  p something
  pp

Though, this wouldn't be equivalent to what new people, who just want to call `debug()` with the arg, would expect :) If you want to deduplicate the function call, I can reorganize the code to be like this:

define pp
 if ($argc == 0)
   set $arg = $
 else
   set $arg = $arg0
 end
 call debug ($arg)
end



Reply via email to