[PATCH 2/2] gdbinit.in: fix wrong reference to function argument

Konstantin Kharlamov hi-angel@yandex.ru
Thu Nov 14 07:01:00 GMT 2019



On Ср, ноя 13, 2019 at 15:23, Jason Merrill <jason@redhat.com> 
wrote:
> On Wed, Nov 13, 2019 at 6:39 AM Segher Boessenkool 
> <segher@kernel.crashing.org> wrote:
>> On Tue, Nov 12, 2019 at 04:17:17PM +0300, Konstantin Kharlamov wrote:
>>  > On Вт, ноя 12, 2019 at 14:08, Andreas Schwab <schwab@suse.de>
>>  > wrote:
>>  > >On Nov 12 2019, Konstantin Kharlamov wrote:
>>  > >> I'm definitely missing something. Who are these users, and how 
>> can
>>  > >>they
>>  > >> make anything useful of these functions if they don't even 
>> pass an
>>  > >> argument?
>>  > >
>>  > >By printing the desired value.
>>  >
>>  > Hah, okay. Well, in this case their workflow now gonna be 2 times
>>  > simpler since they don't have to type in two commands, but only 
>> one :)
>> 
>>  Do we have to type parentheses now?  That more than undoes that 
>> gain :-/
>> 
>>  > Besides, I suspect, the number of actual users of this gdbinit is
>>  > around zero, otherwise someone would have noticed the warning 
>> that gdb
>>  > prints on every usage of these functions while the PATCH 1/2 is 
>> not
>>  > applied.
>> 
>>  There are users.  There are users who have been used to this 
>> behaviour
>>  for many many many years.
>> 
>>  People just do (say I have an "rtx insn"):
>>    p insn
>>    pr
> 
> Indeed.  I use this constantly.

Thanks everyone for answers. No, you don't have to type parentheses. 
Gdb has it like in Haskell, i.e. arguments are separated by just 
whitespace. So you type `pr insn`

You know what, I came up with an alternative solution that won't break 
anyone's workflow neither confuse newbies: I can add a check for number 
of arguments, and to branch on that to use either $ or $arg0.

I'll resend then a bit later the patchset with the fixed changelog for 
the 1st patch, and these alternative changes for the 2nd patch.




More information about the Gcc-patches mailing list