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, Alexander Monakov wrote:
> On Thu, 14 Nov 2019, Konstantin Kharlamov wrote:
>
> > I also named `dbgarg` as `debug_arg` because I figured I confuse whether it
> > was `gdbarg` or `gdbarg` :D
>
> It should begin with a dollar ($debug_arg), otherwise GDB will attempt to locate
> and use a variable named 'debug_arg' in the program being debugged.
>
> In any case, I feel we should avoid adding a dependency on GDB-Python here.
Here's a one-liner that uses eval instead:
eval "set $debug_arg = $%s", $argc ? "arg0" : ""
call debug ($debug_arg)
(but oddly with '$argc ? "$arg0" : ""' it doesn't work). Can you rework your
patch to use this approach?
Alexander