Re: [PATCH v2 2/2] gdbinit.in: allow to pass function argument explicitly

2019-11-14 Thread Alexander Monakov
On Thu, 14 Nov 2019, Konstantin Kharlamov wrote: > Haha, this is amazing! Will do. A newbish question: shall I send the updated > patch "in reply" here, or should I resend the patchset? Your choice, GCC doesn't have a hard rule for this. Personally I feel it's more appropriate to send patches "i

Re: [PATCH v2 2/2] gdbinit.in: allow to pass function argument explicitly

2019-11-14 Thread Konstantin Kharlamov
On Чт, ноя 14, 2019 at 18:00, Alexander Monakov wrote: 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 d

Re: [PATCH v2 2/2] gdbinit.in: allow to pass function argument explicitly

2019-11-14 Thread Alexander Monakov
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 > loca

Re: [PATCH v2 2/2] gdbinit.in: allow to pass function argument explicitly

2019-11-14 Thread Alexander Monakov
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 d

Re: [PATCH v2 2/2] gdbinit.in: allow to pass function argument explicitly

2019-11-14 Thread Andreas Schwab
On Nov 14 2019, Konstantin Kharlamov wrote: > python (I dunno, I can ‾\_(ツ)_/‾). The code: Python support is optional. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: [PATCH v2 2/2] gdbinit.in: allow to pass function argument explicitly

2019-11-14 Thread Konstantin Kharlamov
On Чт, ноя 14, 2019 at 16:57, Alexander Monakov wrote: 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

Re: [PATCH v2 2/2] gdbinit.in: allow to pass function argument explicitly

2019-11-14 Thread Alexander Monakov
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) >

Re: [PATCH v2 2/2] gdbinit.in: allow to pass function argument explicitly

2019-11-14 Thread Konstantin Kharlamov
On Чт, ноя 14, 2019 at 16:13, Alexander Monakov 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

Re: [PATCH v2 2/2] gdbinit.in: allow to pass function argument explicitly

2019-11-14 Thread Alexander Monakov
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 us

Re: [PATCH v2 2/2] gdbinit.in: allow to pass function argument explicitly

2019-11-14 Thread Konstantin Kharlamov
On Чт, ноя 14, 2019 at 15:55, Alexander Monakov wrote: On Thu, 14 Nov 2019, Konstantin Kharlamov wrote: Generally, people expect functions to accept arguments directly. But ones defined in gdbinit did not use the argument, which may be confusing for newcomers. But we can't change behav

Re: [PATCH v2 2/2] gdbinit.in: allow to pass function argument explicitly

2019-11-14 Thread Alexander Monakov
On Thu, 14 Nov 2019, Konstantin Kharlamov wrote: > Generally, people expect functions to accept arguments directly. But > ones defined in gdbinit did not use the argument, which may be confusing > for newcomers. But we can't change behavior to use the argument without > breaking existing users of