This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]