This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v2 2/2] gdbinit.in: allow to pass function argument explicitly
On Thu, 14 Nov 2019, Konstantin Kharlamov wrote:
> 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
I wish there was a less verbose way :) I don't insist on this deduplication, so
at this point I guess it's up to the reviewers. Your suggestion seems slightly
preferable to duplicating commands, but please wait for feedback from others.
Alexander